diff options
author | Joe Sak <joe@joesak.com> | 2010-11-20 13:59:27 -0600 |
---|---|---|
committer | Joe Sak <joe@joesak.com> | 2010-11-20 13:59:27 -0600 |
commit | 2f94c8c08aec64403fdecf3a13d20dc35a595fb5 (patch) | |
tree | a241d59d20989fab950cc3500c22a5a23fc6f220 /app/controllers/blog/posts_controller.rb | |
parent | cab02942d0838219ea491f61bbb3c647221e0531 (diff) | |
download | refinerycms-blog-2f94c8c08aec64403fdecf3a13d20dc35a595fb5.tar.gz refinerycms-blog-2f94c8c08aec64403fdecf3a13d20dc35a595fb5.tar.bz2 refinerycms-blog-2f94c8c08aec64403fdecf3a13d20dc35a595fb5.zip |
ajaxify the nav
Diffstat (limited to 'app/controllers/blog/posts_controller.rb')
-rw-r--r-- | app/controllers/blog/posts_controller.rb | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/app/controllers/blog/posts_controller.rb b/app/controllers/blog/posts_controller.rb index 8c627fd..10ec867 100644 --- a/app/controllers/blog/posts_controller.rb +++ b/app/controllers/blog/posts_controller.rb @@ -1,18 +1,36 @@ class Blog::PostsController < BlogController before_filter :find_all_blog_posts, :except => [:archive] - before_filter :find_blog_post, :only => [:show, :comment] + before_filter :find_blog_post, :only => [:show, :comment, :update_nav] + + respond_to :html, :js, :rss if Rails.version >= '3.0.0' def index - respond_to do |format| - format.html - format.rss + if Rails.version < '3.0.0' + # TODO: respond_to block + else + respond_with (@blog_posts) do |format| + format.html + format.rss + end end end def show @blog_comment = BlogComment.new - present(@page) + + 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 + end + end + + def update_nav + render :partial => 'nav' end def comment @@ -49,6 +67,11 @@ 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 end protected |