forked from ryanb/railscasts-episodes
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
150 changed files
with
2,611 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
RailsCasts Episode #284: Active Admin | ||
|
||
http://railscasts.com/episodes/284-active-admin | ||
|
||
Commands used in episode | ||
|
||
bundle | ||
rails g active_admin:install | ||
rake db:migrate | ||
rails g active_admin:resource product |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.bundle | ||
db/*.sqlite3 | ||
log/*.log | ||
tmp/ | ||
.sass-cache/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
source 'http://rubygems.org' | ||
|
||
gem 'rails', '3.1.0' | ||
|
||
# Bundle edge Rails instead: | ||
# gem 'rails', :git => 'git://github.com/rails/rails.git' | ||
|
||
gem 'sqlite3' | ||
|
||
gem 'activeadmin' | ||
|
||
|
||
# Gems used only for assets and not required | ||
# in production environments by default. | ||
group :assets do | ||
gem 'sass-rails', " ~> 3.1.0" | ||
gem 'coffee-rails', "~> 3.1.0" | ||
gem 'uglifier' | ||
end | ||
|
||
gem 'jquery-rails' | ||
|
||
# Use unicorn as the web server | ||
# gem 'unicorn' | ||
|
||
# Deploy with Capistrano | ||
# gem 'capistrano' | ||
|
||
# To use debugger | ||
# gem 'ruby-debug19', :require => 'ruby-debug' | ||
|
||
group :test do | ||
# Pretty printed test output | ||
gem 'turn', :require => false | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,155 @@ | ||
GEM | ||
remote: http://rubygems.org/ | ||
specs: | ||
actionmailer (3.1.0) | ||
actionpack (= 3.1.0) | ||
mail (~> 2.3.0) | ||
actionpack (3.1.0) | ||
activemodel (= 3.1.0) | ||
activesupport (= 3.1.0) | ||
builder (~> 3.0.0) | ||
erubis (~> 2.7.0) | ||
i18n (~> 0.6) | ||
rack (~> 1.3.2) | ||
rack-cache (~> 1.0.3) | ||
rack-mount (~> 0.8.2) | ||
rack-test (~> 0.6.1) | ||
sprockets (~> 2.0.0) | ||
activeadmin (0.3.1) | ||
devise (>= 1.1.2) | ||
fastercsv | ||
formtastic (>= 1.1.0) | ||
inherited_resources (< 1.3.0) | ||
kaminari (>= 0.12.4) | ||
meta_search (>= 0.9.2) | ||
rails (>= 3.0.0) | ||
sass (>= 3.1.0) | ||
activemodel (3.1.0) | ||
activesupport (= 3.1.0) | ||
bcrypt-ruby (~> 3.0.0) | ||
builder (~> 3.0.0) | ||
i18n (~> 0.6) | ||
activerecord (3.1.0) | ||
activemodel (= 3.1.0) | ||
activesupport (= 3.1.0) | ||
arel (~> 2.2.1) | ||
tzinfo (~> 0.3.29) | ||
activeresource (3.1.0) | ||
activemodel (= 3.1.0) | ||
activesupport (= 3.1.0) | ||
activesupport (3.1.0) | ||
multi_json (~> 1.0) | ||
ansi (1.3.0) | ||
arel (2.2.1) | ||
bcrypt-ruby (3.0.1) | ||
builder (3.0.0) | ||
coffee-rails (3.1.1) | ||
coffee-script (>= 2.2.0) | ||
railties (~> 3.1.0) | ||
coffee-script (2.2.0) | ||
coffee-script-source | ||
execjs | ||
coffee-script-source (1.1.2) | ||
devise (1.4.5) | ||
bcrypt-ruby (~> 3.0) | ||
orm_adapter (~> 0.0.3) | ||
warden (~> 1.0.3) | ||
erubis (2.7.0) | ||
execjs (1.2.6) | ||
multi_json (~> 1.0) | ||
fastercsv (1.5.4) | ||
formtastic (1.2.4) | ||
actionpack (>= 2.3.7) | ||
activesupport (>= 2.3.7) | ||
i18n (~> 0.4) | ||
has_scope (0.5.1) | ||
hike (1.2.1) | ||
i18n (0.6.0) | ||
inherited_resources (1.2.2) | ||
has_scope (~> 0.5.0) | ||
responders (~> 0.6.0) | ||
jquery-rails (1.0.14) | ||
railties (~> 3.0) | ||
thor (~> 0.14) | ||
kaminari (0.12.4) | ||
rails (>= 3.0.0) | ||
mail (2.3.0) | ||
i18n (>= 0.4.0) | ||
mime-types (~> 1.16) | ||
treetop (~> 1.4.8) | ||
meta_search (1.1.1) | ||
actionpack (~> 3.1.0) | ||
activerecord (~> 3.1.0) | ||
activesupport (~> 3.1.0) | ||
polyamorous (~> 0.5.0) | ||
mime-types (1.16) | ||
multi_json (1.0.3) | ||
orm_adapter (0.0.5) | ||
polyamorous (0.5.0) | ||
activerecord (~> 3.0) | ||
polyglot (0.3.2) | ||
rack (1.3.3) | ||
rack-cache (1.0.3) | ||
rack (>= 0.4) | ||
rack-mount (0.8.3) | ||
rack (>= 1.0.0) | ||
rack-ssl (1.3.2) | ||
rack | ||
rack-test (0.6.1) | ||
rack (>= 1.0) | ||
rails (3.1.0) | ||
actionmailer (= 3.1.0) | ||
actionpack (= 3.1.0) | ||
activerecord (= 3.1.0) | ||
activeresource (= 3.1.0) | ||
activesupport (= 3.1.0) | ||
bundler (~> 1.0) | ||
railties (= 3.1.0) | ||
railties (3.1.0) | ||
actionpack (= 3.1.0) | ||
activesupport (= 3.1.0) | ||
rack-ssl (~> 1.3.2) | ||
rake (>= 0.8.7) | ||
rdoc (~> 3.4) | ||
thor (~> 0.14.6) | ||
rake (0.9.2) | ||
rdoc (3.9.4) | ||
responders (0.6.4) | ||
sass (3.1.7) | ||
sass-rails (3.1.2) | ||
actionpack (~> 3.1.0) | ||
railties (~> 3.1.0) | ||
sass (>= 3.1.4) | ||
sprockets (~> 2.0.0) | ||
tilt (~> 1.3.2) | ||
sprockets (2.0.0) | ||
hike (~> 1.2) | ||
rack (~> 1.0) | ||
tilt (!= 1.3.0, ~> 1.1) | ||
sqlite3 (1.3.4) | ||
thor (0.14.6) | ||
tilt (1.3.3) | ||
treetop (1.4.10) | ||
polyglot | ||
polyglot (>= 0.3.1) | ||
turn (0.8.2) | ||
ansi (>= 1.2.2) | ||
tzinfo (0.3.29) | ||
uglifier (1.0.3) | ||
execjs (>= 0.3.0) | ||
multi_json (>= 1.0.2) | ||
warden (1.0.5) | ||
rack (>= 1.0) | ||
|
||
PLATFORMS | ||
ruby | ||
|
||
DEPENDENCIES | ||
activeadmin | ||
coffee-rails (~> 3.1.0) | ||
jquery-rails | ||
rails (= 3.1.0) | ||
sass-rails (~> 3.1.0) | ||
sqlite3 | ||
turn | ||
uglifier |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
= RailsCasts Example Application | ||
|
||
Run these commands to try it out. | ||
|
||
bundle | ||
rake db:migrate | ||
rake db:fixtures:load | ||
rails s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env rake | ||
# Add your own tasks in files placed in lib/tasks ending in .rake, | ||
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. | ||
|
||
require File.expand_path('../config/application', __FILE__) | ||
|
||
Store::Application.load_tasks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
ActiveAdmin::Dashboards.build do | ||
|
||
section "Recent Products" do | ||
table_for Product.order("released_at desc").limit(5) do | ||
column :name do |product| | ||
link_to product.name, [:admin, product] | ||
end | ||
column :released_at | ||
end | ||
strong { link_to "View All Products", admin_products_path } | ||
end | ||
|
||
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
ActiveAdmin.register Product do | ||
scope :unreleased | ||
|
||
index do | ||
column :name | ||
column :category | ||
column "Release Date", :released_at | ||
column :price, :sortable => :price do |product| | ||
div :class => "price" do | ||
number_to_currency product.price | ||
end | ||
end | ||
default_actions | ||
end | ||
end |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
//= require active_admin/base |
9 changes: 9 additions & 0 deletions
9
episode-284/store-after/app/assets/javascripts/application.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// This is a manifest file that'll be compiled into including all the files listed below. | ||
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically | ||
// be included in the compiled file accessible from http://example.com/assets/application.js | ||
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the | ||
// the compiled file. | ||
// | ||
//= require jquery | ||
//= require jquery_ujs | ||
//= require_tree . |
3 changes: 3 additions & 0 deletions
3
episode-284/store-after/app/assets/javascripts/products.js.coffee
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Place all the behaviors and hooks related to the matching controller here. | ||
# All this logic will automatically be available in application.js. | ||
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/ |
10 changes: 10 additions & 0 deletions
10
episode-284/store-after/app/assets/stylesheets/active_admin.css.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Active Admin CSS Styles | ||
@import "active_admin/mixins"; | ||
@import "active_admin/base"; | ||
|
||
// To customize the Active Admin interfaces, add your | ||
// styles here: | ||
|
||
.price { | ||
text-align: right; | ||
} |
Oops, something went wrong.