Browse files

fixed issue #59 - merge home controller into pages controller

  • Loading branch information...
1 parent 0e9a798 commit 01a39e9ce1a0850cc4ea8a16c14b85421c028d09 @mokolabs mokolabs committed Feb 26, 2012
View
7 app/controllers/home_controller.rb
@@ -1,7 +0,0 @@
-class HomeController < ApplicationController
-
- def index
- @podcast = Podcast.published.first
- end
-
-end
View
14 app/controllers/pages_controller.rb
@@ -1,7 +1,19 @@
class PagesController < ApplicationController
+ def about
+ end
+
+ def index
+ @podcast = Podcast.published.first
+ end
+
def sponsors
- return "sponsors"
+ end
+
+ def thanks
+ end
+
+ def tshirts
end
end
View
0 app/views/home/_sponsors.haml → app/views/pages/_sponsors.haml
File renamed without changes.
View
1 app/views/pages/about.haml
@@ -0,0 +1 @@
+%h1=t "About SD Ruby"
View
0 app/views/home/index.haml → app/views/pages/index.haml
File renamed without changes.
View
1 app/views/pages/sponsors.haml
@@ -0,0 +1 @@
+%h1=t "Sponsors"
View
0 app/views/home/thanks.haml → app/views/pages/thanks.haml
File renamed without changes.
View
0 app/views/home/tshirts.haml → app/views/pages/tshirts.haml
File renamed without changes.
View
14 config/routes.rb
@@ -1,13 +1,18 @@
SDRuby::Application.routes.draw do
- match "/tshirts" => "home#tshirts", as: :tshirts
- match "/thanks" => "home#thanks", as: :thanks
+
+ # Homepage
+ root to: 'pages#index'
+
+ # Custom routes
+ match "/tshirts" => "pages#tshirts", as: :tshirts
+ match "/thanks" => "pages#thanks", as: :thanks
match "/logout" => "user_sessions#destroy", as: :logout
match "/login" => "user_sessions#new", as: :login
match "/register" => "users#new", as: :register
- match "/forgot" => "users#forgot_password", as: :password_reset
-
match "/sponsors" => "pages#sponsors", as: :sponsors
+ match "/forgot" => "users#forgot_password", as: :password_reset
+ # Resources
resources :podcasts do
get :search, on: :collection
end
@@ -19,5 +24,4 @@
resources :users
resource :user_session
- root to: 'home#index'
end

0 comments on commit 01a39e9

Please sign in to comment.