# Postback Action Problem

**URL:** <https://www.ruby-forum.com/t/postback-action-problem/64832>\
**Category:** Rails\
**Created:** [August 15, 2006, 2:19pm UTC](https://www.ruby-forum.com/t/postback-action-problem/64832 "2006-08-15T14:19:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![xplodersuv](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/bb73d2/32.png) [@xplodersuv](https://www.ruby-forum.com/u/xplodersuv)\
**Post date:** [August 15, 2006, 2:19pm UTC](https://www.ruby-forum.com/t/postback-action-problem/64832/1 "2006-08-15T14:19:39Z")

</div>

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](http://localhost:3000/xxxxx/edit/x)

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

---

<div class="post-metadata">

**Author:** ![xplodersuv](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/bb73d2/32.png) [@xplodersuv](https://www.ruby-forum.com/u/xplodersuv)\
**Post date:** [August 25, 2006, 8:42am UTC](https://www.ruby-forum.com/t/postback-action-problem/64832/2 "2006-08-25T08:42:09Z")

</div>

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](http://www.nabble.com/Postback-Action-Problem-tf2101737.html#a5978139)  
Sent from the RubyOnRails Users forum at [Nabble.com](http://Nabble.com).
