I'm currently trying to convert an ERB layout to HAML.
This is the error I keep receiving:
index.html.haml:18: syntax error, unexpected ')'
));}\n #{_hamlout.format_...
Here is the HAML page:
.row-fluid
.span6
%h2 Todo List
.span6
%h2{:style => "text-align:right;"} <script>document.write(today)</script>
%hr.divider
.row-fluid
.span6
%h2.small_head New Task
= render :partial => 'layouts/form_errors', :locals => {:object => @list}
.form
= form_for :list, :url => {:controller => 'lists', :action => 'create'} do |f|
= label_tag :list_name, "Title", :class => 'header_label'
I have also tried this as a variation:
= form_for(:list, :url => {:controller => 'lists', :action => 'create'}) do |f|
= label_tag(:list_name, "Title", :class => 'header_label')
Neither work and both generate the same error message, and help greatly appreciated.
You need to indent the code in the do
block. This should work:
= form_for :list, :url => {:controller => 'lists', :action => 'create'} do |f|
= label_tag :list_name, "Title", :class => 'header_label'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With