Class: Wafflemix::CategoriesController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Wafflemix::CategoriesController
- Defined in:
- app/controllers/wafflemix/categories_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
Instance Method Details
#index ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'app/controllers/wafflemix/categories_controller.rb', line 5 def index @categories = Category.all @tags = Post.tag_counts_on(:tags) respond_to do |format| format.html format.json { render json: @categories } end end |
#show ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'app/controllers/wafflemix/categories_controller.rb', line 15 def show @category = Category.find(params[:id]) @posts = @category.posts.published @tags = Post.tag_counts_on(:tags) respond_to do |format| format.html format.json { render json: @category } end end |