ryan heath
2006-Mar-04 04:33 UTC
[Rails] How to redirect_to the same page after comment posting?
How can I have the page redirect_to the same page after someone posts a comment? I know that you can do "redirect_to :action => ''index''", but the page is located at this URL: /posts/2006/02/01/individual_post/ So, the action is "individual" which is in the "posts" controller, but there is a custom URL mapped for the URL shown above. How can I reload the page with the new comment? Also, if anyone has some good Ajax tips, that would be great too! Thanks! -- Posted via http://www.ruby-forum.com/.
Xavier Noria
2006-Mar-04 06:08 UTC
[Rails] How to redirect_to the same page after comment posting?
On Mar 4, 2006, at 5:33, ryan heath wrote:> How can I have the page redirect_to the same page after someone > posts a > comment? > > I know that you can do "redirect_to :action => ''index''", but the > page is > located at this URL: > > /posts/2006/02/01/individual_post/ > > So, the action is "individual" which is in the "posts" controller, but > there is a custom URL mapped for the URL shown above. How can I > reload > the page with the new comment?Depending on the exact flow redirect_to :back might be enough. -- fxn
ryan heath
2006-Mar-04 06:44 UTC
[Rails] Re: How to redirect_to the same page after comment posting?
Any other ideas? I tried that one, didn''t work out. Thanks for the input, though! -- Posted via http://www.ruby-forum.com/.
oo00oo
2006-Mar-04 07:05 UTC
[Rails] Re: How to redirect_to the same page after comment posting?
ryan heath a ?crit :> Any other ideas? I tried that one, didn''t work out. Thanks for the > input, though! > >rhtml: <%= form_tag( { :controller => my_con , :action => "my_act" } %> .... my_con_controller.rb: def my_act if request.get? # first pass else # after post end end
Peter Ertl
2006-Mar-04 08:17 UTC
[Rails] How to redirect_to the same page after comment posting?
redirect_to request.request_uri> --- Urspr?ngliche Nachricht --- > Von: ryan heath <rheath@ircwv.com> > An: rails@lists.rubyonrails.org > Betreff: [Rails] How to redirect_to the same page after comment posting? > Datum: Sat, 4 Mar 2006 05:33:28 +0100 > > How can I have the page redirect_to the same page after someone posts a > comment? > > I know that you can do "redirect_to :action => ''index''", but the page is > located at this URL: > > /posts/2006/02/01/individual_post/ > > So, the action is "individual" which is in the "posts" controller, but > there is a custom URL mapped for the URL shown above. How can I reload > the page with the new comment? > > Also, if anyone has some good Ajax tips, that would be great too! > > Thanks! > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >