Rails Mountable Engine "update" method inaccessible -


i have project mounted engine within it. far, works expect except "update" functionality. engine controller created via scaffold, , looks expect to. index, show, edit, delete work expected, associated before , after filter actions.

however, update throws following exception:

screen:

nomethoderror in meetmemanagerplugin::conferenceroomscontroller#update  private method `update' called #<meetmemanagerplugin::conferenceroom:0x007fe8ac24a080> 

console:

nomethoderror (private method `update' called #<meetmemanagerplugin::conferenceroom:0x007fe8ac24a080>):   activemodel (3.2.13) lib/active_model/attribute_methods.rb:404:in `method_missing'   activerecord (3.2.13) lib/active_record/attribute_methods.rb:149:in `method_missing'   /volumes/macthecrypt 1/project work/jkl5_projects/meetme_manager_plugin/app/controllers/meetme_manager_plugin/conference_rooms_controller.rb:57:in `update'   actionpack (3.2.13) lib/action_controller/metal/implicit_render.rb:4:in `send_action'   actionpack (3.2.13) lib/abstract_controller/base.rb:167:in `process_action'   actionpack (3.2.13) lib/action_controller/metal/rendering.rb:10:in `process_action'   actionpack (3.2.13) lib/abstract_controller/callbacks.rb:18:in `block in process_action' 

the actual code in controller looks like:

def update   if @conference_room.update(conference_room_params)     redirect_to @conference_room, notice: 'conference room updated.'   else     render action: 'edit'   end end 

what choking on "@conference_room.update(conference_room_params)".

a fair bit of web searching hasn't yet put light on this, figured here might have suggestion. in advance, , let me know if need further me.

the work around problem use "update_attributes" , not "update":

def update   if @conference_room.update_attributes(conference_room_params)     redirect_to @conference_room, notice: 'conference room updated.'   else     render action: 'edit'   end end # def update 

works fine way. while i'm still not sure why other approach borken, given it's scaffold code, allow program execution complete without error.


Comments