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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 8 Nov 2007, at 16:04, jebw wrote:> > 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?You probably wanted to write redirect_to :action => :index Fred --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 8 Nov 2007, at 16:04, jebw wrote: > > > > > > > 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? > > You probably wanted to write redirect_to :action => :index > > Fred--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---