Created
March 7, 2017 12:18
-
-
Save kethlinmil/d20f4c2d0efb7b8c3fc94d86b2f0da11 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= "<%= form_for @#{singular_name} do |f| %%>" %> | |
<div class="row"> | |
<div class="col-md-4"> | |
<%= "<% if @#{singular_name}.errors.any? %%>" %> | |
<div id="error_explanation"> | |
<%= "<h2><%= pluralize(@#{singular_name}.errors.count, 'error') %%>" %> prohibited this <%= class_name %> from being saved:</h2> | |
<ul class="list-unstyled"> | |
<%= "<% @#{singular_name}.errors.full_messages.each do |message| %%>" %> | |
<%= "<li><%= message %%></li>" %> | |
<%= "<% end %%>" %> | |
</ul> | |
</div> | |
<%= "<% end %%>" %> | |
<% editable_attributes.each do |attribute| %> | |
<div class="form-group"> | |
<%= "<%= f.label :#{attribute.name} %%>" %> | |
<%= "<%= f.#{attribute.field_type} :#{attribute.name}, class: \"form-control\" %%>" %> | |
</div> | |
<% end -%> | |
<%= "<%= f.submit 'Submit', class: \"btn btn-success\" %%>" %> | |
</div> | |
</div> | |
<%= "<% end %%>" %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment