Class: ArticlesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ArticlesController
- Defined in:
- app/controllers/articles_controller.rb
Instance Method Summary collapse
-
#category ⇒ Object
get /articles/:category_slug.
-
#index ⇒ Object
get /articles.
-
#show ⇒ Object
get /articles/:post_id-:post_slug.
Instance Method Details
#category ⇒ Object
get /articles/:category_slug
12 13 14 |
# File 'app/controllers/articles_controller.rb', line 12 def category @collection = @category.posts.page_for_visitors(current_page) end |
#index ⇒ Object
get /articles
6 7 8 9 |
# File 'app/controllers/articles_controller.rb', line 6 def index post_type = PostType.find_by(slug: 'article') @collection = post_type.posts.page_for_visitors(current_page) end |
#show ⇒ Object
get /articles/:post_id-:post_slug
17 18 19 |
# File 'app/controllers/articles_controller.rb', line 17 def show @entity.increment!(:view_count) end |