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