Sha256: a75b5367761dc897bbc07bbc1a4e16d4e73eb700ceb04d5788760bbad80a755b
Contents?: true
Size: 1.94 KB
Versions: 39
Compression:
Stored size: 1.94 KB
Contents
<div class="page-header"> <h1><%%= @title %></h1> </div> <%%= form_for @<%= resource_name %>, html: { class: 'form-horizontal' } do |f| %> <%% if @<%= resource_name %>.errors.any? %> <div id="error_explanation" class="bs-callout bs-callout-danger"> <h4><%%= pluralize(@<%= resource_name %>.errors.count, "error") %> prohibited this <%= resource_name %> from being saved</h4> <ul> <%% @<%= resource_name %>.errors.full_messages.each do |msg| %> <li><%%= msg %></li> <%% end %> </ul> </div> <%% end %> <%- columns.each do |column| -%> <div class="form-group"> <% unless column.field_type == :check_box %><%%= f.label :<%= column.name %>, nil, class: 'col-md-2 control-label' %><% end %> <div class="<%- if column.field_type == :check_box %>col-md-offset-2 <%- end -%>col-md-10"> <%- if column.name.split('_').last == 'id' -%> <%%= f.select :<%= column.name %>, [['---', nil]] + <%= column.name.split('_')[0..-2].join('_').camelize %>.current.collect{|<%= column.name.first %>| [<%= column.name.first %>.name, <%= column.name.first %>.id]}, {}, class: 'form-control' %> <%- elsif column.field_type == :date_select -%> <%%= f.text_field :<%= column.name %>, class: 'datepicker form-control', value: @<%= resource_name %>.<%= column.name %> ? @<%= resource_name %>.<%= column.name %>.strftime('%m/%d/%Y') : '' %> <%- elsif column.field_type == :check_box -%> <div class="checkbox"> <label> <%%= f.check_box :<%= column.name %> %> <%= column.name.humanize %> </label> </div> <%- else -%> <%%= f.<%= column.field_type %> :<%= column.name %><%= ", rows: 7" if column.field_type == :text_area %>, class: 'form-control' %> <%- end -%> </div> </div> <%- end -%> <div class="form-group"> <div class="col-md-offset-2 col-md-10"> <%%= f.submit nil, class: 'btn btn-primary' %> <%%= cancel %> </div> </div> <%% end %>
Version data entries
39 entries across 39 versions & 1 rubygems