Hei Jesse,
if you pass arguments to a form tag like that, they will be added as
html attributes...
So, the HTML code that:
%form{ :method => 'get', :controller => 'compare', :action =>
root_path, :class => "f_r", :style => "width: 190px" }
will generate is:
<form method="get" controller="compare" action="/" class="f_r"
style="width:190px">
and HTML doesn't know a controller html attribute..
I think you are looking for for the rails form_tag or form_for methods:
- form_for @food, :url => root_path, :html => {:method => :get} do |f|
%fieldset
=f.text_field :compare_food, :class => 'f_r'
=f.submit 'Compare', :class => 'f_r'
otherwise you could also do:
%form.f_r{ :method => 'get', :action => url_for(:controller =>
'compare'), :style => "width: 190px" }
%fieldset
=text_field_tag 'compare_food', params[:compare_food], { :class => 'f_r' }
=submit_tag 'Compare', { :name => nil, :class => "f_r" }
(although 'compare' sounds like a strange controller definition and
more like an action..)
I hope this helps you a bit further.
-Filip
2008/11/25 Jesse <[EMAIL PROTECTED]>:
>
> What am I doing wrong here? Error, 'no attribute "controller"':
>
> %form{ :method => 'get', :controller => 'compare', :action =>
> root_path, :class => "f_r", :style => "width: 190px" }
> %fieldset
> = text_field_tag 'compare_food', params[:compare_food], { :class
> => 'f_r'}
> = submit_tag 'Compare', { :name => nil, :class => "f_r" }
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Haml" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/haml?hl=en
-~----------~----~----~----~------~----~------~--~---