Class: Wafflemix::CategoriesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- Wafflemix::CategoriesController
- Defined in:
- app/controllers/wafflemix/categories_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
Instance Method Details
#index ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'app/controllers/wafflemix/categories_controller.rb', line 7 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
17 18 19 20 21 22 23 24 25 26 |
# File 'app/controllers/wafflemix/categories_controller.rb', line 17 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 |