Forum: Ruby on Rails start_form_tag how to use the options parameter ?

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.
Chris C. (Guest)
on 2006-03-23 13:00
Hello, I don't understand how to use the options parameter of
start_form_tag
I want to have the class and id attributes of the form initialized to
"Foo"...

I suppose it's something like
start_form_tag( :options['class'] => 'Foo', :options['id'] => 'Foo')

But I can't figure out the right syntax...



Thank you in advance...
Chris C. (Guest)
on 2006-03-23 13:14
Got it :
<%= start_form_tag( {}, {:class => 'Foo'}) %>

But why do I need to provide an empty {} (empty list ? empty collectin ?
empty array ? what is this ?) ?

I tought that the order of the parameters was not important as long as
there have a name ?

So
<%= start_form_tag( options = {:class => 'Foo'}) %>

does not work - why ??
This topic is locked and can not be replied to.