noesya/osuny

View on GitHub
app/views/admin/communication/websites/menus/new.html.erb

Summary

Maintainability
Test Coverage
<% content_for :title, Communication::Website::Menu.model_name.human %>

<%= simple_form_for [:admin, @menu] do |f| %>
  <%= f.error_notification %>
  <%= f.error_notification message: f.object.errors[:base].to_sentence if f.object.errors[:base].present? %>

  <div class="row">
    <div class="col-md-8">
      <%= f.input :title %>
    </div>
    <div class="col-md-4">
      <%= render  "admin/application/slug/form",
                  f: f,
                  attribute: :identifier,
                  max_length: Communication::Website::Menu::IDENTIFIER_MAX_LENGTH,
                  source: '#communication_website_menu_title' if can?(:create, @menu) %>
    </div>
  </div>
  <% content_for :action_bar_right do %>
    <%= submit f %>
  <% end %>
<% end %>