rails generate simple_form:install
This commit is contained in:
parent
718407f1ac
commit
2db00d5d3d
3 changed files with 219 additions and 0 deletions
12
lib/templates/haml/scaffold/_form.html.haml
Normal file
12
lib/templates/haml/scaffold/_form.html.haml
Normal file
|
@ -0,0 +1,12 @@
|
|||
-# frozen_string_literal: true
|
||||
= simple_form_for(@<%= singular_table_name %>) do |f|
|
||||
= f.error_notification
|
||||
= f.error_notification message: f.object.errors[:base].to_sentence if f.object.errors[:base].present?
|
||||
|
||||
.form-inputs
|
||||
<%- attributes.each do |attribute| -%>
|
||||
= f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %>
|
||||
<%- end -%>
|
||||
|
||||
.form-actions
|
||||
= f.button :submit
|
Loading…
Add table
Add a link
Reference in a new issue