I''d like to use the form helper to create a form, and I''d like to give the form a name, so that I can more easily refer to it with javascript. However, when I try this: <%= start_form_tag :action=> "login", :name=> "login" %> I get an error: Unknown options: name. I also tried putting the options between curly braces and that didn''t seem to work either. Is there a way to use a form helper to do what I am trying to do? Thanks, Carl
I''m not sure this is right (haven''t tested it), but
I''d guess this would work:
<%= start_form_tag {}, { :action => "login", :name =>
"login" } %>
Cheers,
Ben
On Wed, 09 Feb 2005 15:18:10 -0800, Carl Youngblood
<carlwork-0CEYHQKyN7s@public.gmane.org> wrote:> I''d like to use the form helper to create a form, and I''d
like to give
> the form a name, so that I can more easily refer to it with javascript.
>
> However, when I try this:
>
> <%= start_form_tag :action=> "login", :name=>
"login" %>
>
> I get an error: Unknown options: name.
>
> I also tried putting the options between curly braces and that
didn''t
> seem to work either. Is there a way to use a form helper to do what I
> am trying to do?
>
> Thanks,
> Carl
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
Make that:
<%= start_form_tag { :action => "login" }, { :name =>
"login" } %>
On Wed, 9 Feb 2005 16:26:47 -0700, Ben Schumacher
<benschumacher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> I''m not sure this is right (haven''t tested it), but
I''d guess this would work:
>
> <%= start_form_tag {}, { :action => "login", :name =>
"login" } %>
>
> Cheers,
>
> Ben
>
>
> On Wed, 09 Feb 2005 15:18:10 -0800, Carl Youngblood
<carlwork-0CEYHQKyN7s@public.gmane.org> wrote:
> > I''d like to use the form helper to create a form, and
I''d like to give
> > the form a name, so that I can more easily refer to it with
javascript.
> >
> > However, when I try this:
> >
> > <%= start_form_tag :action=> "login", :name=>
"login" %>
> >
> > I get an error: Unknown options: name.
> >
> > I also tried putting the options between curly braces and that
didn''t
> > seem to work either. Is there a way to use a form helper to do what I
> > am trying to do?
> >
> > Thanks,
> > Carl
> > _______________________________________________
> > Rails mailing list
> > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> > http://lists.rubyonrails.org/mailman/listinfo/rails
> >
>
Ben Schumacher wrote:>Make that: > ><%= start_form_tag { :action => "login" }, { :name => "login" } %> >I''m afraid that gave me a compile error during rendering. Thanks, Carl
Ben Schumacher wrote:>Make that: > ><%= start_form_tag { :action => "login" }, { :name => "login" } %> >However, I just figured out that this fixed it: <%= start_form_tag( {:action => "login"}, {:name => "login"}) %> I needed to put parens around the two hashes. Thanks, Carl
On Wed, 2005-02-09 at 15:43 -0800, Carl Youngblood wrote:> Ben Schumacher wrote: > > >Make that: > > > ><%= start_form_tag { :action => "login" }, { :name => "login" } %> > > > I''m afraid that gave me a compile error during rendering.<%= start_form_tag :action => "login", { "name" => "login" } %> Any other option in the form open tag can be added like the above. -- Steven Critchfield <critch-wQLwMjUOumVBDgjK7y7TUQ@public.gmane.org>