diff options
| author | mo k <mo@mokhan.ca> | 2012-02-29 20:50:23 -0700 |
|---|---|---|
| committer | mo k <mo@mokhan.ca> | 2012-02-29 20:50:23 -0700 |
| commit | 29fc85fbec3ca220d6dfaa38ea7e71c2c195ec7e (patch) | |
| tree | b7d73ed17100d7908cde9c662e1e8a7369de877c /app | |
| parent | d07feb75ec40f68a8b011d3a61195798c2d78cae (diff) | |
add active admin. go to http://??/admin/ username:admin@example.com password:password
Diffstat (limited to 'app')
| -rw-r--r-- | app/admin/dashboards.rb | 38 | ||||
| -rw-r--r-- | app/assets/javascripts/active_admin.js | 1 | ||||
| -rw-r--r-- | app/assets/stylesheets/active_admin.css.scss | 6 | ||||
| -rw-r--r-- | app/models/admin_user.rb | 9 |
4 files changed, 54 insertions, 0 deletions
diff --git a/app/admin/dashboards.rb b/app/admin/dashboards.rb new file mode 100644 index 00000000..cdf4c9c6 --- /dev/null +++ b/app/admin/dashboards.rb @@ -0,0 +1,38 @@ +ActiveAdmin::Dashboards.build do + + # Define your dashboard sections here. Each block will be + # rendered on the dashboard in the context of the view. So just + # return the content which you would like to display. + + # == Simple Dashboard Section + # Here is an example of a simple dashboard section + # + # section "Recent Posts" do + # ul do + # Post.recent(5).collect do |post| + # li link_to(post.title, admin_post_path(post)) + # end + # end + # end + + # == Render Partial Section + # The block is rendered within the context of the view, so you can + # easily render a partial rather than build content in ruby. + # + # section "Recent Posts" do + # div do + # render 'recent_posts' # => this will render /app/views/admin/dashboard/_recent_posts.html.erb + # end + # end + + # == Section Ordering + # The dashboard sections are ordered by a given priority from top left to + # bottom right. The default priority is 10. By giving a section numerically lower + # priority it will be sorted higher. For example: + # + # section "Recent Posts", :priority => 10 + # section "Recent User", :priority => 1 + # + # Will render the "Recent Users" then the "Recent Posts" sections on the dashboard. + +end diff --git a/app/assets/javascripts/active_admin.js b/app/assets/javascripts/active_admin.js new file mode 100644 index 00000000..d2b66c59 --- /dev/null +++ b/app/assets/javascripts/active_admin.js @@ -0,0 +1 @@ +//= require active_admin/base diff --git a/app/assets/stylesheets/active_admin.css.scss b/app/assets/stylesheets/active_admin.css.scss new file mode 100644 index 00000000..9b2dc9d7 --- /dev/null +++ b/app/assets/stylesheets/active_admin.css.scss @@ -0,0 +1,6 @@ +// Active Admin CSS Styles +@import "active_admin/mixins"; +@import "active_admin/base"; + +// To customize the Active Admin interfaces, add your +// styles here: diff --git a/app/models/admin_user.rb b/app/models/admin_user.rb new file mode 100644 index 00000000..039464fa --- /dev/null +++ b/app/models/admin_user.rb @@ -0,0 +1,9 @@ +class AdminUser < ActiveRecord::Base + # Include default devise modules. Others available are: + # :token_authenticatable, :encryptable, :confirmable, :lockable, :timeoutable and :omniauthable + devise :database_authenticatable, + :recoverable, :rememberable, :trackable, :validatable + + # Setup accessible (or protected) attributes for your model + attr_accessible :email, :password, :password_confirmation, :remember_me +end |
