# Ajax in ruby on rails

**URL:** <https://rubytalk.org/t/ajax-in-ruby-on-rails/36285>\
**Category:** ruby-talk\
**Created:** [20 March 2007 06:29 UTC](https://rubytalk.org/t/ajax-in-ruby-on-rails/36285 "2007-03-20T06:29:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Saravanankumar\_Sarav](https://avatars.discourse-cdn.com/v4/letter/s/aca169/32.png) [@Saravanankumar\_Sarav](https://rubytalk.org/u/Saravanankumar_Sarav)\
**Post date:** [20 March 2007 06:29 UTC](https://rubytalk.org/t/ajax-in-ruby-on-rails/36285/1 "2007-03-20T06:29:51Z")

</div>

Hi,  
&nbsp;&nbsp;I have user model & a method to edit it.  
&nbsp;&nbsp;Using normal ruby with html, i did it.  
&nbsp;&nbsp;But, using ajax i want to submit the page.

&nbsp;&nbsp;I know there is a tag  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"\<%=form\_remote\_tag %\> "  
&nbsp;&nbsp;But, already i've used  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"\<% form\_for :user ...%\>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;I want to submit the page using ajax.  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Is it possible? If, it is, please help me to how to do it?

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Thanks.

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

**Author:** ![Deepak\_Kumar\_Shivhar](https://avatars.discourse-cdn.com/v4/letter/d/958977/32.png) [@Deepak\_Kumar\_Shivhar](https://rubytalk.org/u/Deepak_Kumar_Shivhar)\
**Post date:** [20 March 2007 06:42 UTC](https://rubytalk.org/t/ajax-in-ruby-on-rails/36285/2 "2007-03-20T06:42:03Z")

</div>

Saravanankumar Saravanan wrote:

> Hi,  
> &nbsp;&nbsp;I have user model & a method to edit it.  
> &nbsp;&nbsp;Using normal ruby with html, i did it.  
> &nbsp;&nbsp;But, using ajax i want to submit the page.
> 
> &nbsp;&nbsp;I know there is a tag  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"\<%=form\_remote\_tag %\> "  
> &nbsp;&nbsp;But, already i've used  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"\<% form\_for :user ...%\>
> 
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;I want to submit the page using ajax.  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Is it possible? If, it is, please help me to how to do it?
> 
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Thanks.

Hello,

Check it out the following link. May it will help you.

[http://blog.invisible.ch/files/rails-reference-1.1.html#form\_for](http://blog.invisible.ch/files/rails-reference-1.1.html#form_for)

and  
Having multiple submit buttons is fairly easy with a regular form\_for  
tag. You merely create your submit buttons like below.

\<%= submit\_tag "Send", :name =\> "send\_button" %\>  
\<%= submit\_tag "Save Draft", :name =\> "draft\_button" %\>

Thanx  
Deepak  
[http://www.ajuby.com](http://www.ajuby.com)

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).
