Namespace BlogController into Blog::BaseController
This commit is contained in:
parent
de4cc6b9ef
commit
be7d341532
4 changed files with 19 additions and 17 deletions
17
app/controllers/refinery/blog/base_controller.rb
Normal file
17
app/controllers/refinery/blog/base_controller.rb
Normal file
|
@ -0,0 +1,17 @@
|
|||
module Refinery
|
||||
module Blog
|
||||
class BaseController < ::ApplicationController
|
||||
|
||||
include ControllerHelper
|
||||
|
||||
helper :'refinery/blog_posts'
|
||||
before_filter :find_page, :find_all_blog_categories
|
||||
|
||||
protected
|
||||
|
||||
def find_page
|
||||
@page = Refinery::Page.find_by_link_url("/blog")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,6 +1,6 @@
|
|||
module Refinery
|
||||
module Blog
|
||||
class CategoriesController < BlogController
|
||||
class CategoriesController < BaseController
|
||||
|
||||
def show
|
||||
@category = Refinery::BlogCategory.find(params[:id])
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
module Refinery
|
||||
module Blog
|
||||
class PostsController < BlogController
|
||||
class PostsController < BaseController
|
||||
|
||||
caches_page :index
|
||||
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
module Refinery
|
||||
class BlogController < ::ApplicationController
|
||||
|
||||
include Blog::ControllerHelper
|
||||
|
||||
helper :'refinery/blog_posts'
|
||||
before_filter :find_page, :find_all_blog_categories
|
||||
|
||||
protected
|
||||
|
||||
def find_page
|
||||
@page = Refinery::Page.find_by_link_url("/blog")
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue