How would I write this simple_form in haml:
<%= simple_form_for (@quiz) do |f| %>
<%= f.error_notification %>
<div class="inputs">
<%= f.input :body %>
<%= f.fields_for :quiz_choices do |builder| %>
<%= render "quiz_choice_fields", :f => builder %>
<% end %>
<p><%= link_to_add_association "Add a choice",f, :quiz_choices %></p>
</div>
<div class="actions">
<%= f.button :submit %>
</div>
<% end %>
Here is my try:
- simple_form_for (@quiz) do |f|
- f.error_notification
.inputs
= f.input :body
- f.fields_for :quiz_choices do |builder|
= render "quiz_choice_fields", :f => builder
%p= link_to_add_association "Add a choice",f, :quiz_choices
.actions
= f.button :submit
Here is the error:
Extracted source (around line #12):
9: .actions
10: = f.button :submit
Well any time you have
<%=, it should become=in haml, not-. Also, for a loop or block, you need to indent the code under it.Should become: