Class: PagesCms::PagesController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- PagesCms::PagesController
- Defined in:
- app/controllers/pages_cms/pages_controller.rb
Instance Method Summary collapse
Instance Method Details
#blog ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'app/controllers/pages_cms/pages_controller.rb', line 13 def blog slug = params[:slug] || '' @blog = Blog.find_by_slug(slug) if @blog @articles = @blog.articles.search(params[:tags]) render 'pages_cms/pages/blog' else redirect_to root_path end end |
#home ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'app/controllers/pages_cms/pages_controller.rb', line 24 def home @page = Page.home if @page render 'pages_cms/pages/show' else redirect_to '/404.html' end end |
#show ⇒ Object
4 5 6 7 8 9 10 11 |
# File 'app/controllers/pages_cms/pages_controller.rb', line 4 def show @page = Page.find_by_slug(params[:slug]) if @page render 'pages_cms/pages/show' else redirect_to root_path end end |