Sha256: 4bfb5f2ccfb8058946c57e69473fe5593d688aa751988e81dc3f5ec9723653db

Contents?: true

Size: 1.48 KB

Versions: 53

Compression:

Stored size: 1.48 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">
      <h2><%%= pluralize(@<%= resource_name %>.errors.count, "error") %> prohibited this <%= resource_name %> from being saved:</h2>

      <ul>
      <%% @<%= resource_name %>.errors.full_messages.each do |msg| %>
        <li><%%= msg %></li>
      <%% end %>
      </ul>
    </div>
  <%% end %>

  <%- columns.each do |column| -%>
  <div class="control-group">
    <%%= f.label :<%= column.name %>, nil, class: 'control-label' %>
    <div class="controls">
      <%- 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]} %>
      <%- elsif column.field_type == :date_select -%>
      <%%= f.text_field :<%= column.name %>, class: 'datepicker', value: @<%= resource_name %>.<%= column.name %> ? @<%= resource_name %>.<%= column.name %>.strftime('%m/%d/%Y') : '' %>
      <%- else -%>
      <%%= f.<%= column.field_type %> :<%= column.name %><%= ", rows: 7, style: 'width:95%'" if column.field_type == :text_area %> %>
      <%- end -%>
    </div>
  </div>

  <%- end -%>
  <div class="form-actions">
    <%%= f.submit nil, class: 'btn btn-primary' %>
    <%%= cancel %>
  </div>
<%% end %>

Version data entries

53 entries across 53 versions & 1 rubygems

Version Path
contour-2.1.0.beta3 lib/generators/contour/scaffold/templates/_form.html.erb
contour-2.1.0.beta2 lib/generators/contour/scaffold/templates/_form.html.erb
contour-2.1.0.beta1 lib/generators/contour/scaffold/templates/_form.html.erb
contour-2.0.0 lib/generators/contour/scaffold/templates/_form.html.erb
contour-2.0.0.rc6 lib/generators/contour/scaffold/templates/_form.html.erb
contour-2.0.0.rc5 lib/generators/contour/scaffold/templates/_form.html.erb
contour-2.0.0.rc4 lib/generators/contour/scaffold/templates/_form.html.erb
contour-2.0.0.rc3 lib/generators/contour/scaffold/templates/_form.html.erb
contour-2.0.0.rc2 lib/generators/contour/scaffold/templates/_form.html.erb
contour-2.0.0.rc lib/generators/contour/scaffold/templates/_form.html.erb
contour-2.0.0.beta.9 lib/generators/contour/scaffold/templates/_form.html.erb
contour-2.0.0.beta.8 lib/generators/contour/scaffold/templates/_form.html.erb
contour-2.0.0.beta.7 lib/generators/contour/scaffold/templates/_form.html.erb
contour-2.0.0.beta.6 lib/generators/contour/scaffold/templates/_form.html.erb
contour-2.0.0.beta.5 lib/generators/contour/scaffold/templates/_form.html.erb
contour-2.0.0.beta.4 lib/generators/contour/scaffold/templates/_form.html.erb
contour-2.0.0.beta.3 lib/generators/contour/scaffold/templates/_form.html.erb
contour-2.0.0.beta.2 lib/generators/contour/scaffold/templates/_form.html.erb
contour-2.0.0.beta.1 lib/generators/contour/scaffold/templates/_form.html.erb
contour-1.3.0 lib/generators/contour/scaffold/templates/_form.html.erb