Making use of modules and putting classes under modules.

This commit is contained in:
Philip Arndt 2011-07-01 09:14:46 +12:00
parent 47a71b309f
commit 7028ef3ddd
7 changed files with 260 additions and 238 deletions

View file

@ -1,7 +1,11 @@
class Admin::Blog::CategoriesController < Admin::BaseController
module Admin
module Blog
class CategoriesController < Admin::BaseController
crudify :blog_category,
:title_attribute => :title,
:order => 'title ASC'
end
end
end

View file

@ -1,4 +1,6 @@
class Admin::Blog::CommentsController < Admin::BaseController
module Admin
module Blog
class CommentsController < Admin::BaseController
crudify :blog_comment,
:title_attribute => :name,
@ -34,3 +36,5 @@ class Admin::Blog::CommentsController < Admin::BaseController
end
end
end
end

View file

@ -1,4 +1,6 @@
class Admin::Blog::PostsController < Admin::BaseController
module Admin
module Blog
class PostsController < Admin::BaseController
crudify :blog_post,
:title_attribute => :title,
@ -84,3 +86,5 @@ protected
@blog_categories = BlogCategory.find(:all)
end
end
end
end

View file

@ -1,4 +1,6 @@
class Admin::Blog::SettingsController < Admin::BaseController
module Admin
module Blog
class SettingsController < Admin::BaseController
def notification_recipients
@recipients = BlogComment::Notification.recipients
@ -37,3 +39,5 @@ class Admin::Blog::SettingsController < Admin::BaseController
end
end
end
end

View file

@ -1,4 +1,5 @@
class Blog::CategoriesController < BlogController
module Blog
class CategoriesController < BlogController
def show
@category = BlogCategory.find(params[:id])
@ -9,3 +10,4 @@ class Blog::CategoriesController < BlogController
end
end
end

View file

@ -1,4 +1,5 @@
class Blog::PostsController < BlogController
module Blog
class PostsController < BlogController
before_filter :find_all_blog_posts, :except => [:archive]
before_filter :find_blog_post, :only => [:show, :comment, :update_nav]
@ -99,3 +100,4 @@ protected
end
end
end

View file

@ -1,4 +1,5 @@
class Blog::CommentMailer < ActionMailer::Base
module Blog
class CommentMailer < ActionMailer::Base
def notification(comment, request)
subject BlogComment::Notification.subject
@ -9,3 +10,4 @@ class Blog::CommentMailer < ActionMailer::Base
end
end
end