stimpy
July 30, 2008, 2:44pm
1
According to the output of my spec tests:
download url
Clone the repository using:
git clone git://github.com/Radar/rboard.git
All the code is there, I promise you.
controller.rb
def update
@rank = Rank.find(params[:id])
if @rank.update_attributes(params[:rank])
flash[:notice] = "#{@rank.name} has been updated."
redirect_to admin_ranks_path
else
flash[:notice] = "#{@rank.name} has not been updated."
render :action => "edit"
end
end
error.rb
ActionController::RenderError in 'Admin::RanksController shouldn't be able to update a rank with invalid attributes'
You called render with invalid options : {:action=>"edit", :layout=>false}, nil
/Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:843:in `render_with_no_layout'
/Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/action_controller/layout.rb:251:in `render_without_benchmark'
/Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/action_controller/benchmarking.rb:51:in `render'
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.0/lib/active_support/core_ext/benchmark.rb:8:in `realtime'
/Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/action_controller/benchmarking.rb:51:in `render'
/Users/ryanbigg/Sites/rboard/app/controllers/admin/ranks_controller.rb:34:in `update'
/Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:1162:in `send'
/Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:1162:in `perform_action_without_filters'
This file has been truncated. show original
There are more than three files. show original
Using something like render :action => “edit” is now invalid… even
though when I do the action in the browser Rails complains of no such
thing. Rails and RSpec are at the latest versions and I’m at a
complete loss as to what the devil’s going on here! Any suggestions?