On Jan 8, 12:56 pm, bourne <[email protected]> wrote: > Rails3.0.3, Controller:Method update: > > 1. Redirect to Show, flash is shown, works > format.html { > redirect_to(@article, :notice => 'Article was successfully > saved.') > } > > 2- Redirect to Edit, flash is shown, works > format.html { > flash[:notice] = 'Article was successfully saved.' > redirect_to(:action => 'edit') > } > > 3. Redirect to Edit, flash is NOT shown > format.html { > redirect_to(:action => 'edit', :notice => 'Article was > successfully saved.') > } > > Can someone explain this behaviour to me?
In the third case, rails thinks that :notice is part of the routing options - you can probably see that the url redirected to has ? notice=... on it. Ruby can't know that the first bit is for the routing options has and that the second bit is for the other options hash. On the other hand, in the first case it is unambiguous 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

