Sha256: b2af6bda3e037cb69d9895b2c46aa166f1386afb43abad2e4e716ff4db2b5180

Contents?: true

Size: 587 Bytes

Versions: 4

Compression:

Stored size: 587 Bytes

Contents

= form_for <%= belongs_to ? "[@#{parent_name}, @#{model_name}]" : "@#{model_name}" %> do |f|
  -if @<%= singular_table_name %>.errors.any?
    #error_explanation
      %h2= "#{pluralize(@<%= singular_table_name %>.errors.count, "error")} prohibited this <%= singular_table_name %> from being saved:"
      %ul
        - @<%= singular_table_name %>.errors.full_messages.each do |msg|
          %li= msg

<% for attribute in attributes -%>
  .field
    = f.label :<%= attribute.name %>
    = f.<%= attribute.field_type %> :<%= attribute.name %>
<% end -%>
  .actions
    = f.submit 'Save'

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
my_generators-0.0.4 lib/generators/my_generators/scaffold/templates/_form.html.haml
my_generators-0.0.3 lib/generators/my_generators/scaffold/templates/_form.html.haml
my_generators-0.0.2 lib/generators/my_generators/scaffold/templates/_form.html.haml
my_generators-0.0.1 lib/generators/my_generators/scaffold/templates/_form.html.haml