Added simple form for easier form building.
This commit is contained in:
parent
ca15bb1102
commit
03d84aed1d
9 changed files with 185 additions and 5 deletions
13
lib/templates/erb/scaffold/_form.html.erb
Normal file
13
lib/templates/erb/scaffold/_form.html.erb
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<%%= simple_form_for(@<%= singular_name %>) do |f| %>
|
||||
<%%= f.error_notification %>
|
||||
|
||||
<div class="inputs">
|
||||
<%- attributes.each do |attribute| -%>
|
||||
<%%= f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %> %>
|
||||
<%- end -%>
|
||||
</div>
|
||||
|
||||
<div class="actions">
|
||||
<%%= f.button :submit %>
|
||||
</div>
|
||||
<%% end %>
|
||||
Loading…
Add table
Add a link
Reference in a new issue