Sha256: ed4770d95bbe27a82a9d661aefce52e2714998f2d7af1e896c2c17c1afbd286e

Contents?: true

Size: 859 Bytes

Versions: 16

Compression:

Stored size: 859 Bytes

Contents

%h2 New <%= @name.human.downcase %>

= form_for @<%= @name.element %>, url: cms_<%= @name.collection %>_path, html: {class: 'form-horizontal'} do |f|
<% @type.attributes.each do |attribute| -%>
  .control-group
    = f.label :<%= attribute.field_name %>, class: 'control-label'
<% if attribute.orderable? -%>
    .controls
      = f.<%= attribute.form_type %> :<%= attribute.name %>, 1.upto(CMS::<%= @name %>.count + 1).to_a
<% elsif attribute.reference? -%>
    .controls
      = f.<%= attribute.form_type %> :<%= attribute.field_name %>, CMS::<%= attribute.reference_to %>.all.collect {|r| [ r.<%= attribute.options['reference_label'] %>, r.id ] }
<% else -%>
    .controls
      = f.<%= attribute.form_type %> :<%= attribute.name %>
<% end -%>
<% end -%>
  .form-actions
    = f.submit 'Save', class: 'btn btn-primary', :'data-disable-with' => 'Saving...'

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
honey-cms-0.3.8 lib/generators/cms/templates/views/new.html.haml
honey-cms-0.3.7 lib/generators/cms/templates/views/new.html.haml
honey-cms-0.3.5 lib/generators/cms/templates/views/new.html.haml
honey-cms-0.3.4 lib/generators/cms/templates/views/new.html.haml
honey-cms-0.3.3 lib/generators/cms/templates/views/new.html.haml
honey-cms-0.3.2 lib/generators/cms/templates/views/new.html.haml
honey-cms-0.3.1 lib/generators/cms/templates/views/new.html.haml
honey-cms-0.3.0 lib/generators/cms/templates/views/new.html.haml
honey-cms-0.2.4 lib/generators/cms/templates/views/new.html.haml
honey-cms-0.2.3 lib/generators/cms/templates/views/new.html.haml
honey-cms-0.2.2 lib/generators/cms/templates/views/new.html.haml
honey-cms-0.2.1 lib/generators/cms/templates/views/new.html.haml
honey-cms-0.2.0 lib/generators/cms/templates/views/new.html.haml
honey-cms-0.1.2 lib/generators/cms/templates/views/new.html.haml
honey-cms-0.1.1 lib/generators/cms/templates/views/new.html.haml
honey-cms-0.1.0 lib/generators/cms/templates/views/new.html.haml