|
|
|
@@ -26,7 +26,11 @@ class TagsController < ApplicationController |
|
|
|
|
|
|
|
def show |
|
|
|
tag = Tag.find_by(id: params[:id]) |
|
|
|
render json: tag.as_json(only: [:id, :category, :post_count], methods: [:name, :has_wiki]) |
|
|
|
if tag |
|
|
|
render json: tag.as_json(only: [:id, :category, :post_count], methods: [:name, :has_wiki]) |
|
|
|
else |
|
|
|
head :not_found |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
def show_by_name |
|
|
|
|