docs/customizing_page_views.md in administrate-1.0.0.beta1 vs docs/customizing_page_views.md in administrate-1.0.0.beta2
- old
+ new
@@ -92,5 +92,30 @@
rails generate administrate:views:navigation
# It only generates the sidebar partial
# -> app/views/admin/application/_navigation.html.erb
```
+
+## Customizing for a specific layout
+
+You can use several hook points to add elements to specific layouts or specific pages:
+
+* header_middle
+* header_last
+* before_main
+* main
+* after_main
+
+For example, you can add a button in the middle of the header as follows:
+
+```eruby
+<%# app/views/admin/customers/_index_header.html.erb %>
+
+<% content_for(:header_middle) do %>
+ <div>
+ You are logged in as <em><%= pundit_user.name %></em>.
+ <%= link_to("Become the Admin", become_admin_customer_path("admin")) unless pundit_user.admin? %>
+ </div>
+<% end %>
+
+<%= render template: 'administrate/application/_index_header', locals: local_assigns %>
+```