Sha256: fd117b0ccdcb1a177e4d1c8a5e84b328cf3fc99196449ba74ee2e9e2b93c4eab

Contents?: true

Size: 1.53 KB

Versions: 2

Compression:

Stored size: 1.53 KB

Contents

<%- model_class = @content.class -%>
<div class="page-header">
  <h3><%=t '.title', :default => t('helpers.titles.define', :model => model_class.model_name.human,
                   :default => "Edit #{@content.slug or model_class.model_name.human}") %></h3>
</div>
<%= form_for @content,  :html => { :class => 'form-horizontal' } do |f| %>
  <% if @content.errors.any? %>
    <div class="errors">
        <h3>ERROR!</h3>
        <ul>
          <% @content.errors.full_messages.each do |msg| %>
            <%= content_tag :li, msg %>
          <% end %>
        </ul>
    </div>
  <% end %>
  <%= render :partial => 'fields_new', :locals => {f: f} %>
  <%= render :partial => 'fields_edit', :locals => {f: f} %>
  <hr/>
  <%= link_to_add_fields "+ seo", f, :seo unless @content.seo %>
  <%= f.fields_for :seo do |seo| %>
    <%= render :partial => 'seo_fields', :locals => {f: seo} %>
  <% end %>
  <h4>Resources</h4>
  <%= link_to_add_fields "Add Resource", f, :resources %>

  <%= f.fields_for :resources do |res| %>
    <%= render :partial => 'resource_fields', :locals => {f: res} %>
  <% end %>
 <h4>Children</h4>
  <%= link_to_add_fields "Add Child", f, :child_contents %>
 <%= render :partial => 'show_children', object: @content.child_contents %>
  <div class="form-actions">
    <%= f.submit nil, :class => 'btn btn-primary' %>
    <%= link_to t('.cancel', :default => t("helpers.links.cancel")),
                contents_path, :class => 'btn' %>
  </div>

<%  end %>

<% content_for :breadcrumb do %>
  <%= content_tag :anchor, @content.ancestry %>
<% end %>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
common-content-0.0.4 app/views/contents/edit.html.erb
common-content-0.0.3 app/views/contents/edit.html.erb