backbone.js for rails 3.2.13 - ruby-on-rails-3

I am using rails 3.2.13 and ruby 1.9.3
I tried to use gem "rails-backbone", '0.9.10' but it is not working properly as per REST
Are there any other changes required to bo done for rails 3.2.13?
I used scaffold to generate crud but REST api is not working with crud operations

Related

how to configure Active admin support for mongoid and active record both?

I develop one application in rails which support mongodb CRUD and postgress CRUD its working with both database.
Now I like to make admin interface which communicate with both database. Mongodb and postgress.
I install below gem
gem "mongoid", "~> 4.0.0"
gem 'bson_ext'
gem 'activeadmin', github: 'gregbell/active_admin'
gem 'ransack', github: 'activerecord-hackery/ransack'
gem "activeadmin-mongoid", git: "git://github.com/elia/activeadmin-mongoid.git"
I configure active admin as describe below
http://activeadmin.info/docs/0-installation.html#initialize_active_admin
Now my active_admin work with mongodb model but not working with active_recode model
its give me below error
Don't know what context to use for AdminUser
Please help me support both database on active admin
MongoDB is not officially supported by ActiveAdmin version 1.0.0.pre1. I expect that someone will develop an adapter once ActiveAdmin reaches 1.0.

Rails 4 Authentication using Devise with MongoMapper

I am working on a Rails 4 app and would like to use MongoMapper and Devise for authentication. When I add devise to my Gemfile and bundle install it goes fine and I am able to rails g devise:install, and it picks up that I am using MongoMapper as my ORM. When I try to rails g mongo_mapper:config it says it cannot find the generator. Also I know that Devise supports Mongoid by default, but I like MongoMapper and would like to stick with that. I downgraded to Rails 3.2.14 and it seems to work fine. Any ideas on what I may be overlooking, or if Devise/MongoMapper support each other in Rails 4?
I got also errors using the generators to create a model for the devise user.
This worked after using:
gem 'mongo_mapper', '>= 0.13.0.beta2'
gem 'devise'
gem 'mm-devise'
and then in the devise.rb:
require 'devise/orm/mongo_mapper'
After that I did not got into any erros.
gem 'mongo_mapper'
gem 'devise'
gem 'mm-devise'
and also devise.rb should be
require 'mongo_mapper'

integrating CAS authentication on Rails 3

I have integrated RubyCAS-Client from this github https://github.com/rubycas/rubycas-client It is working and bring up my CAS server for authentication... But the problem that I have is after inserting before_filter CASClient::Frameworks::Rails::Filter on my application_controller.rb, my model is not working and I could not add/edit/delete things from my model.
My Rails version is 3.2.6 and ruby version is 1.8.7.
Any help for this problem?
Under "Installation" on the readme for rubycas/rubycas-client it says this:
NOTE: For compatibility with Rails 3 have a look at
http://github.com/zuk/rubycas-client-rails
Edit: That project has been moved to http://github.com/rubycas/rubycas-client-rails

rspec generator in rails 3.2.5

I just upgraded to rails 3.2.5 and now when I generate new controllers I don't get rspec tests generated by default.
I can do rails g controller foo -t rspec, but I'd prefer to just do rails g controller foo.
How do I fix that default?
You need to do rails g rspec:install inside your project folder (presuming you have rspec in your gem file/bundle). That will activate the generators for you.
Mark of Mark's Blog has an excellent article on it here.

How to use rspec_scaffold generator with latest rspec gem

I am a newbie to Rails 3 and Rspec. Kindly excuse my being a novice.
I am trying to use RSpec with Rails 3. I am using rails 3.0.3 and ruby 1.9.2 on ubuntu 10.04 os.
I am currently referring to the tutorial on :- http://www.railsfire.com/article/rspec-behaviour-driven-development-testing-framework. This tutorial not only uses old plugins , but old Rails version of 2.x also.
I am unable to use the old rspec generator ( rspec_scaffold ) with rspec 2.5 and rspec-rails 2.5 gem. As expected I get the following error as given below.
mohnish#mohnish-desktop:~/rails_testing/10Mar11/rspec_demo3$ rails g rspec_scaffold post title:string body:text
Could not find generator rspec_scaffold.
mohnish#mohnish-desktop:~/rails_testing/10Mar11/rspec_demo3$
Could you please tell me how should I give to accordingly for it to work for me using the above RoR configuration.
Thanks
The latest Rspec gems don't require the old generator mentioned above, basically on giving rails g in your rails app you would get all the list of generators with your app.
Thus, once you have installed the Rspec related gems, then give a rails g to your app, you need to basically run only one of the generator command from the modified list that you would get, which is rspec:install and this would be enough to get you up & running at least with a proof of concept(poc).