Class: BlogsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- BlogsController
- Defined in:
- app/controllers/blogs_controller.rb
Instance Method Summary collapse
Instance Method Details
#archive ⇒ Object
5 6 7 |
# File 'app/controllers/blogs_controller.rb', line 5 def archive @posts_by_month = @blog.posts_by_month end |
#feed ⇒ Object
9 10 11 |
# File 'app/controllers/blogs_controller.rb', line 9 def feed @posts = @blog.posts.published end |
#search ⇒ Object
13 14 15 |
# File 'app/controllers/blogs_controller.rb', line 13 def search @posts = params[:keyword] ? @blog.search(params[:keyword]) : [] end |
#show ⇒ Object
17 18 19 |
# File 'app/controllers/blogs_controller.rb', line 17 def show @posts = @blog.posts.page(params[:page]).published.per(@blog.posts_per_page) end |