Using Edge with scaffold_resource here. My update page is throwing a nil error.
"You have a nil object when you didn't expect it! You might have expected an instance of ActiveRecord::Base. The error occurred while evaluating nil.update_attributes"
The form loads properly with all the fields as input , but when I hit update ..bam!
def update
respond_to do |format| if @position.update_attributes(params[:position])
format.html { redirect_to position_url(@position) } format.xml { render :nothing => true } else format.html { render :action => "edit" } format.xml { render :xml => @position.errors.to_xml } end end
The log doesn't point anything out to me but I'll show it regardless in case it helps-
NoMethodError (You have a nil object when you didn't expect it! You might have expected an instance of ActiveRecord::Base. The error occurred while evaluating nil.update_attributes): /app/controllers/positions_controller.rb:93:in `update' /vendor/rails/actionpack/lib/action_controller/mime_responds.rb:104:in `respond_to' /app/controllers/positions_controller.rb:92:in `update' /vendor/rails/actionpack/lib/action_controller/base.rb:1022:in `perform_action_without_filters' /vendor/rails/actionpack/lib/action_controller/filters.rb:628:in `call_filter' /vendor/rails/actionpack/lib/action_controller/filters.rb:634:in `call_filter' /vendor/rails/actionpack/lib/action_controller/filters.rb:453:in `call' /vendor/rails/actionpack/lib/action_controller/filters.rb:633:in `call_filter' /vendor/rails/actionpack/lib/action_controller/filters.rb:615:in `perform_action_without_benchmark' /vendor/rails/actionpack/lib/action_controller/benchmarking.rb:66:in `perform_action_without_rescue' C:/INSTAN~1/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure' /vendor/rails/actionpack/lib/action_controller/benchmarking.rb:66:in `perform_action_without_rescue' /vendor/rails/actionpack/lib/action_controller/rescue.rb:81:in `perform_action' /vendor/rails/actionpack/lib/action_controller/base.rb:425:in `process_without_filters' /vendor/rails/actionpack/lib/action_controller/filters.rb:620:in `process_without_session_management_support' /vendor/rails/actionpack/lib/action_controller/session_management.rb:114:in `process' /vendor/rails/actionpack/lib/action_controller/base.rb:328:in `process' /vendor/rails/railties/lib/dispatcher.rb:41:in `dispatch' C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel/rails.rb:73:in `process' C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel.rb:551:in `process_client' C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel.rb:550:in `process_client' C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel.rb:636:in `run' C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel.rb:636:in `run' C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel.rb:625:in `run' C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel.rb:956:in `run' C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel.rb:955:in `run' C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/bin/mongrel_rails:127:in `run' C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/lib/mongrel/command.rb:199:in `run' C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3-mswin32/bin/mongrel_rails:235 /vendor/rails/activesupport/lib/active_support/dependencies.rb:357:in `load' /vendor/rails/railties/lib/commands/servers/mongrel.rb:48 C:/INSTAN~1/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' /vendor/rails/activesupport/lib/active_support/dependencies.rb:364:in `require' /vendor/rails/railties/lib/commands/server.rb:39 script/server:3