Sha256: da95dff42629d3b196611ab55cc65117c31812461742f03e9eac789212257dc5

Contents?: true

Size: 1.45 KB

Versions: 168

Compression:

Stored size: 1.45 KB

Contents

<%% editing = @event["path"].include?("edit") %>
<%% action = editing ? "/<%= plural_table_name %>/#{<%= singular_table_name %>.id}" : "/<%= plural_table_name %>" %>
<%%= form_tag(action) do %>
<%% if editing -%>
  <input type="hidden" name="_method" value="put" />
<%% end -%>
  <%% if <%= singular_table_name %>.errors.any? %>
    <div id="error_explanation">
      <h2><%%= pluralize(<%= singular_table_name %>.errors.count, "error") %> prohibited this <%= singular_table_name %> from being saved:</h2>

      <ul>
      <%% <%= singular_table_name %>.errors.full_messages.each do |message| %>
        <li><%%= message %></li>
      <%% end %>
      </ul>
    </div>
  <%% end %>

<% attributes.each do |attribute| -%>
  <div class="field">
<% if attribute.password_digest? -%>
    <%%= label_tag :password %>
    <%%= password_field_tag :password, <%= singular_table_name %>.<%= attribute.column_name %> %>
  </div>

  <div class="field">
    <%%= label_tag :password_confirmation %>
    <%%= password_field_tag :password_confirmation, <%= singular_table_name %>.<%= attribute.column_name %> %>
<% else -%>
    <%%= label_tag :<%= attribute.column_name %> %>
    <%%= <%= attribute.field_type %>_tag "<%= "#{singular_table_name}[#{attribute.column_name}]" %>"<%= ", 'yes'" if attribute.field_type =~ /check_box/ %>, <%= singular_table_name %>.<%= attribute.column_name %> %>
<% end -%>
  </div>

<% end -%>
  <div class="actions">
    <%%= submit_tag("Submit") %>
  </div>
<%% end %>

Version data entries

168 entries across 168 versions & 3 rubygems

Version Path
jets-0.5.7 lib/jets/generator/templates/erb/scaffold/_form.html.erb
jets-0.5.6 lib/jets/generator/templates/erb/scaffold/_form.html.erb
jets-0.5.5 lib/jets/generator/templates/erb/scaffold/_form.html.erb
jets-0.5.4 lib/jets/generator/templates/erb/scaffold/_form.html.erb
jets-0.5.3 lib/jets/generator/templates/erb/scaffold/_form.html.erb
jets-0.5.2 lib/jets/generator/templates/erb/scaffold/_form.html.erb
jets-0.5.1 lib/jets/generator/templates/erb/scaffold/_form.html.erb
jets-0.5.0 lib/jets/generator/templates/erb/scaffold/_form.html.erb