Postback Action Problem

I was trying to use postbacks, but its not working.

def edit
@xxxx= xxxx.find_by_id(params[:id]) || xxxx.new
if request.post?
@xxxx.attributes = params[:xxxx]
redirect_to :list and return if @xxxx.save
end
end

I get the following error: SystemStackError in xxxxxController#edit
stack level too deep. The code of list is same as the code generated by
the
scaffold generator. The stack trace is below:

e:/program
files/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:854:in
redirect_to' e:/program files/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:854:in redirect_to’
#{RAILS_ROOT}/app/controllers/xxxxx_controller.rb:23:in `edit’

The record is created but the url is still
http://localhost:3000/xxxxx/edit/x


View this message in context:
http://www.nabble.com/Postback-Action-Problem-tf2101737.html#a5792089
Sent from the RubyOnRails Users forum at Nabble.com.

I ran into the same problem recently and it was basically fuming when I
realized it all boiled down to the incorrect parameters being passed to
redirect_to().

For your code sample below,

redirect_to :list

should be
redirect_to action => :list

xplodersuv wrote:


View this message in context:
http://www.nabble.com/Postback-Action-Problem-tf2101737.html#a5978139
Sent from the RubyOnRails Users forum at Nabble.com.