Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

bys-control/activeadmin_custom_layout

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ActiveadminCustomLayout

Gem Version

This gem allows to change the default layout of ActiveAdmin without monkey patching its code. You can just use standard application layout templates to organize where ActiveAdmin layout sections should be rendered.

Usage

Available exports

The following layout template will render the default ActiveAdmin layout:

<!DOCTYPE html>
<html>
  <head>
    <%= yield :title %>
    <%= yield :stylesheets %>
    <%= yield :javascripts %>
    <%= yield :favicon %>
    <%= yield :meta_tags %>
    <%= yield :favicon %>
    <%= csrf_meta_tag %>
    <%= active_admin_js_data_tag %>
  </head>
  <body class="<%= yield :body_classes %>" >
    <div id="wrapper">
      <%= yield :unsupported_browser %>
      <div class="header" id="header"> <%#= yield :header %>
        <%= yield :site_title %>
        <%= yield :global_navigation %>
        <%= yield :utility_navigation %>
      </div>
      <div class="title_bar" id="title_bar"> <%#= yield :title_bar %>
        <div id="titlebar_left">
          <%= yield :breadcrumb %>
          <%= yield :title_tag %>
        </div>
        <div id="titlebar_right">
          <%= yield :action_items %>
        </div>
      </div>
      <%#= yield :page_content %>
      <%= yield :flash_messages %>
      <div id="active_admin_content" class="<%= (content_for? :sidebar) ? "with_sidebar" : "without_sidebar" %>" >
        <%= yield :main_content %>
        <%= yield :sidebar %>
      </div>
      <%= yield :footer %>
    </div>
  </body>
</html>

When rendering the index view:

<div class="table_tools"> <%#= yield :table_tools %>
  <%= yield :index_batch_actions %>
  <%= yield :index_scopes %>
  <%= yield :index_index_list %>
</div>
<%= yield :index_collection %>

Installation

Add this line to your application's Gemfile:

gem 'activeadmin_custom_layout'

And then execute:

$ bundle

Execute installer:

rails g activeadmin_custom_layout:install

You can override the default gem layout by creating your own using the structure shown above and then modify /app/admin/custom_base_controller.rb file to reference the new layout.

Contributing

Contribution directions go here.

License

The gem is available as open source under the terms of the MIT License.

About

Ruby gem to extract ActiveAdmin page components as content_for tags using rails CaptureHelper. You can then use those tags to customize application layout as with any non-ActiveAdmin Rails application.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Morty Proxy This is a proxified and sanitized view of the page, visit original site.