Sha256: b089a0be630b3ca26ffc1c37d397704f9c6b96d007aab03c48d32e203e361ba1
Contents?: true
Size: 507 Bytes
Versions: 9
Compression:
Stored size: 507 Bytes
Contents
module Admin module Posts class TagsController < Admin::ApplicationController def index @post = Admin::Post.find(params[:post_id]) @tags = Admin::Tag.all end def toggle @post = Admin::Post.find(params[:post_id]) @tag = Admin::Tag.find(params[:tag_id]) if @post.tags.include? @tag @post.tags = @post.tags.where.not(id: @tag.id) else @post.tags << @tag end @post.save! end end end end
Version data entries
9 entries across 9 versions & 1 rubygems