ruby on rails - undefined method `key?' for nil:NilClass when using MongoMapper -


i set new rails application following these instructions. generated new controller , added resources :tickets routes file.

hexapoda::application.routes.draw   resources :tickets end 

this controller (`/app/controllers/tickets_controller.rb').

class ticketscontroller < applicationcontroller   def index     @tickets = ticket.all   end end 

i added new model ticket in /app/models/ticket.rb.

class ticket   include mongomapper::document    key :summary, string, :required => true end 

here's view (/app/views/index.html.erb):

<h1>tickets#index</h1> <p>find me in app/views/tickets/index.html.erb</p> 

now when go /tickets in browser, error message.

nomethoderror in ticketscontroller#index

undefined method `key?' nil:nilclass

i have no idea what's going on. problem? i'm using rails 3.2.5 , mongomapper 0.11.1.

you need latest monomapper master:

gem 'mongo_mapper', github: "jnunemaker/mongomapper" 

and run bundle

explanation: rails 3.2.4 added accessible_attributes method activemodel, mongomapper had this; clobbering each other.

mm issue: issue 419
mm commit fixes: 4d35c67


Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -