Class: BlogController
- Inherits:
-
CartoonistController
- Object
- CartoonistController
- BlogController
- Defined in:
- app/controllers/blog_controller.rb
Instance Method Summary collapse
Instance Method Details
#archives ⇒ Object
2 3 4 5 6 7 8 |
# File 'app/controllers/blog_controller.rb', line 2 def archives @posts = BlogPost.archives cache_page_as "blog/archives.#{cache_type}.tmp.html" do render :layout => "blog_archives" end end |
#feed ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'app/controllers/blog_controller.rb', line 34 def feed respond_to do |format| format.html { redirect_to "/blog/feed" } format.rss do @feed = BlogFeed.new BlogPost.feed cache_page_as "blog/feed.#{cache_type}.tmp.rss" do render :content_type => "application/xml", :layout => "cartoonist" end end end end |
#index ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 |
# File 'app/controllers/blog_controller.rb', line 22 def index @post = BlogPost.current @disabled_prev = true if @post.oldest? @disabled_next = true @title = "Blog for #{Setting[:site_name]}" cache_page_as "blog.#{cache_type}.tmp.html" do render :show cache_page_as ".#{cache_type}.tmp.html" if Cartoonist::RootPath.current_key == :blog end end |
#show ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'app/controllers/blog_controller.rb', line 10 def show @post = BlogPost.from_url_title params[:id] @disabled_prev = @post.oldest? @disabled_next = @post.newest? cache_page_as show_page_cache_path do render end rescue redirect_to "/blog" end |