thingspeak/app/admin/dashboard.rb

29 lines
588 B
Ruby
Raw Normal View History

2014-03-22 18:21:45 +01:00
ActiveAdmin.register_page "Dashboard" do
2014-07-14 19:02:31 +02:00
menu priority: 1, label: "Dashboard"
2014-03-22 18:21:45 +01:00
2014-07-14 19:02:31 +02:00
content title: "Dashboard" do
2014-03-22 18:21:45 +01:00
columns do
column do
panel "Stats" do
para "Total Users: #{User.all.count}"
para "Total Channels: #{Channel.all.count}"
end
end
column do
panel "Recent Channels" do
ul do
Channel.all.order("created_at desc").limit(5).map do |channel|
li link_to(channel.name, admin_channel_path(channel))
end
end
end
end
end
end # content
end