Sha256: 8fa4d20804a51c8cdf469cc7866e37077bf170f27447a593f42bfd2d9d963d80

Contents?: true

Size: 1.25 KB

Versions: 2

Compression:

Stored size: 1.25 KB

Contents

<% if params[:action] == 'new' or params[:action] == 'create' %>
    <% url = admin_create_page_template_path %>
    <% method = 'post' %>
    <% submit_text = 'Create' %>
<% else %>
    <% url = admin_update_page_template_path(@page_template.id) %>
    <% method = 'patch' %>
    <% submit_text = 'Update' %>
<% end %>

<div class="row">
  <div class="large-12 columns">
    <%= form_for @page_template, url: url, method: method do |f| %>
        <% if @page_template.errors.any? %>
            <div id="error_explanation">
              <h2>
                <%= "#{pluralize(@page_template.errors.count, "error")} prohibited this page template from being saved:" %>
              </h2>
              <ul>
                <% @page_template.errors.full_messages.each do |msg| %>
                    <li>
                      <%= msg %>
                    </li>
                <% end %>
              </ul>
            </div>
        <% end %>
        <%= f.label :name, class: 'control-label' %>
        <%= f.text_field :name, class: 'form-control' %>
        <%= f.label :template, class: 'control-label' %>
        <%= f.text_field :template, class: 'form-control' %>
        <%= f.submit submit_text, class: 'button small success', id: 'add' %>
    <% end %>
  </div>
</div>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cavy-0.1.0.beta2 app/views/cavy/admin_page_templates/_form.html.erb
cavy-0.1.0.beta1 app/views/cavy/admin_page_templates/_form.html.erb