1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <%%= simple_form_for(@<%= singular_table_name %>) do |f| %>
- <%% if <%= singular_table_name %>.errors.any? %>
- <div id="error_explanation">
- <h2><%%= pluralize(<%= singular_table_name %>.errors.count, "error") %> prohibited this <%= singular_table_name %> from being saved:</h2>
- <ul>
- <%% <%= singular_table_name %>.errors.full_messages.each do |message| %>
- <li><%%= message %></li>
- <%% end %>
- </ul>
- </div>
- <%% end %>
- <div class="form-inputs">
- <% attributes.each do |attribute| -%>
- <% if attribute.password_digest? -%>
- <%%= f.input :password %>
- <%%= f.input :password_confirmation %>
- <% else -%>
- <%%= f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %> %>
- <% end -%>
- <% end -%>
- </div>
- <div class="form-actions">
- <%% if <%= model_resource_name %>.persisted? %>
- <div class="float-right">
- <%%= link_to 'Destroy', <%= model_resource_name %>, method: :delete, class: "text-danger", data: { confirm: 'Are you sure?' } %>
- </div>
- <%% end %>
- <%%= f.submit class: 'btn btn-primary' %>
- <%% if <%= model_resource_name %>.persisted? %>
- <%%= link_to "Cancel", <%= model_resource_name %>, class: "btn btn-link" %>
- <%% else %>
- <%%= link_to "Cancel", <%= index_helper %>_path, class: "btn btn-link" %>
- <%% end %>
- </div>
- <%% end %>
|