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