Skip to content

Commit 1978f18

Browse files
committed
Add Active Admin links to Dashboard
1 parent a984e59 commit 1978f18

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

app/admin/dashboards.rb

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
11
ActiveAdmin::Dashboards.build do
22

3-
section "Recent Orders" do
3+
section "Recent Orders", :priority => 1 do
44
table_for Order.complete.order('id desc').limit(10) do
5-
column("Date") {|order| pretty_format(order.checked_out_at) }
65
column("State") {|order| status_tag(order.state) }
76
column("Customer"){|order| link_to(order.user.email, admin_customer_path(order.user)) }
87
column("Total") {|order| number_to_currency order.total_price }
98
end
109
end
1110

12-
section "Recent Customers", :priority => 15 do
11+
section "Recent Customers", :priority => 2 do
1312
table_for User.order('id desc').limit(10).each do |customer|
1413
column(:email) {|customer| link_to(customer.email, admin_customer_path(customer)) }
1514
end
1615
end
1716

17+
section "ActiveAdmin Demo", :priority => 3 do
18+
div do
19+
render('/admin/sidebar_links', :model => 'dashboards')
20+
end
21+
end
22+
23+
1824
# Define your dashboard sections here. Each block will be
1925
# rendered on the dashboard in the context of the view. So just
2026
# return the content which you would like to display.

0 commit comments

Comments
 (0)