Forum: Ruby on Rails Specify ID for a form?

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.
Will B. (Guest)
on 2006-01-17 19:25
(Received via mailing list)
Hi all,

I have a a really, really dumb Newb question...  I am trying to use
observe_form to use AJAX calls in order to refresh a particular page
fragment using the form data.

I have run into a stumbling block very early on in the process - how can
I
provide an 'id' attribute to the form_remote_tag or start_form_tag
methods?
Specifying something like :id => 'myForm' doesn't appear to add an ID
attribute in the generated HTML.  Any help would be greatly appreciated!

Thanks,
Will
Jarkko L. (Guest)
on 2006-01-17 19:28
(Received via mailing list)
On 17.1.2006, at 18.44, Will B. wrote:

> help would be greatly appreciated!
You need to separate the html id => ... part into its own
html_options hash:

   <%= start_form_tag({ :action => "edit", :id => @article }, {:id =>
"article_form", :enctype => "multipart/form-data"}) %>

//jarkko
Helmut Sedding (Guest)
on 2006-01-18 18:36
(Received via mailing list)
Hi,

use a hidden fields to add additional parameters. these are not
displayed to the user.

     <%= hidden_field_tag "formid", "myForm" %>

regards
Helmut
This topic is locked and can not be replied to.