Sha256: 434945c8315edfeb16dc0a8eccfcb918fa9270b2d86192eab0715380c666176e

Contents?: true

Size: 629 Bytes

Versions: 2

Compression:

Stored size: 629 Bytes

Contents

<%%= form_for(<%= singular_table_name %>) do |f| %>

  <% attributes.each do |attribute| -%>
    <%
      field_type = case attribute.type
        when :string then :text_field
        when :text   then :text_area
        when :date   then :date_picker
        else :text_field
      end
    %>
    <%%= bootstrap_form_field model: <%= singular_table_name %>, form: f, name: :<%= attribute.name %>, type: :<%= field_type %> %>
  <% end -%>

  <div class="actions">
    <%%= f.button type: :submit, class: 'btn btn-primary' do %><i class="fa fa-floppy-o fa-lg"></i> <%%= t 'scaffold.action.save' %><%% end %>
  </div>

<%% end %>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
repres-bootstrap-2.0 lib/generators/repres/bootstrap/scaffold/templates/_form.html.erb
repres-bootstrap-1.11 lib/generators/repres/bootstrap/scaffold/templates/_form.html.erb