Forum: Ruby on Rails direct to same page

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
xxmithila (Guest)
on 2008-11-09 12:51
(Received via mailing list)
Hi guys....

   I want to drict again same page after submitting values to another
methode in the controller.



ex::

Im in

    post.rhtml

I submit some data to methode


    def mail

    end

then I want to direct again to post.rhtml  page with submission
success message.


please help me.....
mithila
Bill W. (Guest)
on 2008-11-10 00:06
(Received via mailing list)
Hi,

xxmithila

>    I want to drict again same page after submitting values to another
> methode in the controller.

redirect_to :back

should do it for you.

HTH,
Bill
mithila karunarathna (Guest)
on 2008-11-10 09:15
(Received via mailing list)
thankx,
 I'll try it.
Shandy N. (Guest)
on 2008-11-10 17:17
xxmithila wrote:
> Hi guys....
>
>    I want to drict again same page after submitting values to another
> methode in the controller.
>
>
>
> ex::
>
> Im in
>
>     post.rhtml
>
> I submit some data to methode
>
>
>     def mail
>
>     end
>
> then I want to direct again to post.rhtml  page with submission
> success message.
>
> please help me.....
> mithila

You could always use a link_to_remote or form_remote_tag to submit some
data and then just update a div in that page or do nothing. Your app
would appear to run more smoothly if you avoided having to reload the
page again, just a thought.
This topic is locked and can not be replied to.