diff options
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/blog/posts_controller.rb | 34 |
1 files changed, 9 insertions, 25 deletions
diff --git a/app/controllers/blog/posts_controller.rb b/app/controllers/blog/posts_controller.rb index 5de6984..f489039 100644 --- a/app/controllers/blog/posts_controller.rb +++ b/app/controllers/blog/posts_controller.rb @@ -3,29 +3,21 @@ class Blog::PostsController < BlogController before_filter :find_all_blog_posts, :except => [:archive] before_filter :find_blog_post, :only => [:show, :comment, :update_nav] - respond_to :html, :js, :rss if Rails.version >= '3.0.0' + respond_to :html, :js, :rss def index - if Rails.version < '3.0.0' - # TODO: respond_to block - else - respond_with (@blog_posts) do |format| - format.html - format.rss - end + respond_with (@blog_posts) do |format| + format.html + format.rss end end def show @blog_comment = BlogComment.new - if Rails.version < '3.0.0' - # TODO: respond_to block - else - respond_with (@blog_post) do |format| - format.html { present(@page) } - format.js { render :partial => 'post', :layout => false } - end + respond_with (@blog_post) do |format| + format.html { present(@page) } + format.js { render :partial => 'post', :layout => false } end end @@ -33,11 +25,7 @@ class Blog::PostsController < BlogController if (@blog_comment = @blog_post.comments.create(params[:blog_comment])).valid? if BlogComment::Moderation.enabled? or @blog_comment.ham? begin - if Rails.version < '3.0.0' - Blog::CommentMailer.deliver_notification(@blog_comment, request) - else - Blog::CommentMailer.notification(@blog_comment, request).deliver - end + Blog::CommentMailer.notification(@blog_comment, request).deliver rescue logger.warn "There was an error delivering a blog comment notification.\n#{$!}\n" end @@ -63,11 +51,7 @@ class Blog::PostsController < BlogController :page => params[:page], :per_page => RefinerySetting.find_or_set(:blog_posts_per_page, 10) }) - if Rails.version < '3.0.0' - # TODO: respond_to block - else - respond_with (@blog_posts) - end + respond_with (@blog_posts) end protected |