# SystemStackError from redirect\_to

**URL:** <https://www.ruby-forum.com/t/systemstackerror-from-redirect-to/119624>\
**Category:** Rails\
**Created:** [November 8, 2007, 5:05pm UTC](https://www.ruby-forum.com/t/systemstackerror-from-redirect-to/119624 "2007-11-08T17:05:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jebw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/77aa72/32.png) [@jebw](https://www.ruby-forum.com/u/jebw)\
**Post date:** [November 8, 2007, 5:05pm UTC](https://www.ruby-forum.com/t/systemstackerror-from-redirect-to/119624/1 "2007-11-08T17:05:36Z")

</div>

Hi

I’ve got a straightforward piece of code in my controller which will  
consistently produce a SystemStackError.

@newmessage = @message.reply(params[:newmessage])  
return unless request.post?  
if @newmessage.save  
flash[:notice] = “Message Sent”  
redirect\_to :index  
end

The error is occuring on the redirect\_to line, if I comment that line  
out then everything behaves as it should. Does anyone have any ideas  
on what could be causing this?

Thanks

jebw

---

<div class="post-metadata">

**Author:** ![jebw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/77aa72/32.png) [@jebw](https://www.ruby-forum.com/u/jebw)\
**Post date:** [November 8, 2007, 5:13pm UTC](https://www.ruby-forum.com/t/systemstackerror-from-redirect-to/119624/2 "2007-11-08T17:13:14Z")

</div>

On 8 Nov 2007, at 16:04, jebw wrote:

> redirect\_to :index  
> end
> 
> The error is occuring on the redirect\_to line, if I comment that line  
> out then everything behaves as it should. Does anyone have any ideas  
> on what could be causing this?

You probably wanted to write redirect\_to :action =\> :index

Fred

---

<div class="post-metadata">

**Author:** ![jebw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/77aa72/32.png) [@jebw](https://www.ruby-forum.com/u/jebw)\
**Post date:** [November 8, 2007, 6:07pm UTC](https://www.ruby-forum.com/t/systemstackerror-from-redirect-to/119624/3 "2007-11-08T18:07:07Z")

</div>

Cheers, rather obvious.

Believe it or not I’m actually 2/3rds through this site. Sometimes I  
just can’t see the wood for the trees 🙂

jebw

On Nov 8, 4:12 pm, Frederick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
