-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add missing dry scaffold rake include
add favico test
- Loading branch information
Glenn Roberts
committed
Jun 25, 2010
1 parent
ae6f80b
commit 5a762f3
Showing
8 changed files
with
40 additions
and
51 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 |
---|---|---|
|
@@ -8,3 +8,5 @@ require 'rake/testtask' | |
require 'rake/rdoctask' | ||
|
||
require 'tasks/rails' | ||
|
||
require 'dry_scaffold/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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# this is separate from StaticPageController since we use nested layouts | ||
# which means the index page can have its own unique layout | ||
class HomeController < ApplicationController | ||
|
||
def index | ||
end | ||
|
||
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 |
---|---|---|
@@ -1,8 +1,5 @@ | ||
class StaticPageController < ApplicationController | ||
PAGES = %w[about] #allowable (non-index) pages rendered by show action | ||
|
||
def show | ||
render :action => params[:page] | ||
end | ||
|
||
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
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 |
---|---|---|
@@ -1,48 +1,8 @@ | ||
ActionController::Routing::Routes.draw do |map| | ||
map.static_page ':page', | ||
:controller => 'static_page', | ||
:action => 'show', | ||
:page => Regexp.new(%w[about contact].join('|')) | ||
|
||
map.root :controller => 'home' #a replacement for public/index.html | ||
# DRY up the static page controller | ||
map.home ':page', :controller => 'static_page', :action => 'show', :page => Regexp.new(StaticPageController::PAGES.join('|')) | ||
|
||
# The priority is based upon order of creation: first created -> highest priority. | ||
|
||
# Sample of regular route: | ||
# map.connect 'products/:id', :controller => 'catalog', :action => 'view' | ||
# Keep in mind you can assign values other than :controller and :action | ||
|
||
# Sample of named route: | ||
# map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase' | ||
# This route can be invoked with purchase_url(:id => product.id) | ||
|
||
# Sample resource route (maps HTTP verbs to controller actions automatically): | ||
# map.resources :products | ||
|
||
# Sample resource route with options: | ||
# map.resources :products, :member => { :short => :get, :toggle => :post }, :collection => { :sold => :get } | ||
|
||
# Sample resource route with sub-resources: | ||
# map.resources :products, :has_many => [ :comments, :sales ], :has_one => :seller | ||
|
||
# Sample resource route with more complex sub-resources | ||
# map.resources :products do |products| | ||
# products.resources :comments | ||
# products.resources :sales, :collection => { :recent => :get } | ||
# end | ||
|
||
# Sample resource route within a namespace: | ||
# map.namespace :admin do |admin| | ||
# # Directs /admin/products/* to Admin::ProductsController (app/controllers/admin/products_controller.rb) | ||
# admin.resources :products | ||
# end | ||
|
||
# You can have the root of your site routed with map.root -- just remember to delete public/index.html. | ||
# map.root :controller => "welcome" | ||
|
||
# See how all your routes lay out with "rake routes" | ||
|
||
# Install the default routes as the lowest priority. | ||
# Note: These default routes make all actions in every controller accessible via GET requests. You should | ||
# consider removing or commenting them out if you're using named routes and resources. | ||
map.connect ':controller/:action/:id' | ||
map.connect ':controller/:action/:id.:format' | ||
map.root :controller => 'home', :action => 'index' # a replacement for public/index.html, with unique layout | ||
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 @@ | ||
require File.dirname(__FILE__) + '/../spec_helper' | ||
|
||
describe HomeController do | ||
integrate_views | ||
|
||
it "index action should render index template" do | ||
get :index | ||
response.should render_template(:index) | ||
end | ||
|
||
it "should show a favicon" do | ||
pending | ||
lambda { get '/images/favico.ico' }.should_not raise_error ActionController::RoutingError | ||
end | ||
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,5 @@ | ||
require File.dirname(__FILE__) + '/../spec_helper' | ||
|
||
describe HomeHelper do | ||
|
||
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,10 @@ | ||
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper') | ||
|
||
describe "/home/index.html.haml" do | ||
include HomeHelper | ||
|
||
it "should render happily" do | ||
pending | ||
render | ||
end | ||
end |