Sha256: 6faeba457e6a2f7647ea748352c61a56b27e2200ab43d56185467f7f053ffb07

Contents?: true

Size: 638 Bytes

Versions: 4

Compression:

Stored size: 638 Bytes

Contents

form_for @<%= singular_table_name %> do |f|
  markup{|m|
    if @<%= singular_table_name %>.errors.any?
      #error_explanation
      m.h2 "#{pluralize(@<%= singular_table_name %>.errors.count, "error")} prohibited this <%= singular_table_name %> from being saved:"
      m.ul do
        @<%= singular_table_name %>.errors.full_messages.each do |message|
          m.li message
        end
      end
    end
<% attributes.each do |attribute| -%>
    m.div class: 'field' do
      m << f.label(:<%= attribute.name %>)
      m << f.<%= attribute.field_type %>(:<%= attribute.name %>)
    end
<% end -%>
    m << f.submit
  }.html_safe
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
we_bridge-html_builder-0.1.7 lib/generators/builder/scaffold/templates/_form.html.builder
we_bridge-html_builder-0.1.6 lib/generators/builder/scaffold/templates/_form.html.builder
we_bridge-html_builder-0.1.5 lib/generators/builder/scaffold/templates/_form.html.builder
we_bridge-html_builder-0.1.4 lib/generators/builder/scaffold/templates/_form.html.builder