Readme: sample code error? (inputs :for with index) #940

Closed
gl03 opened this Issue May 23, 2013 · 0 comments

Projects

None yet

1 participant

@gl03
gl03 commented May 23, 2013

I'm no expert on formtastic, but shouldn't

<%= semantic_form_for @post do |f| %>
  <%= f.inputs :for => :categories do |category, i| %>
    <% if i <= 2 %>
      <%= f.inputs :name => "Category ##{i}" %>
    <% else %>
      <%= f.inputs :name => "Category ##{i} (optional)" %>
    <% end %>
  <% end %>
  <%= f.actions %>
<% end %>

read

<%= semantic_form_for @post do |f| %>
  <%= f.inputs :for => :categories do |category, i| %>
    <% if i <= 2 %>       
      <%= category.inputs :name => "Category ##{i}" %>
    <% else %>
      <%= category.inputs :name => "Category ##{i} (optional)" %>
    <% end %>
  <% end %>
  <%= f.actions %>
<% end %>

sorry if i'm mistaken...

@justinfrench justinfrench added a commit that closed this issue Jul 4, 2013
@justinfrench Simplify README example
Closes #940
58ef0ee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment