Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def destroy
- @tag = ActsAsTaggableOn::Tag.find_by_name(params[:name])
- @tag_following = current_user.tag_followings.find_by_tag_id( @tag.id )
- if @tag_following && @tag_following.destroy
- logger.debug "The #{@tag} has been deleted"
- @tag_unfollowed = true
- else
- @tag_unfollowed = false
- end
- # if params[:remote]
- respond_to do |format|
- format.js { render 'tags/update' }
- format.any {}
- end
- # else
- # if @tag_unfollowed
- # flash[:notice] = I18n.t('tag_followings.destroy.success', :name => params[:name])
- # else
- # flash[:error] = I18n.t('tag_followings.destroy.failure', :name => params[:name])
- # end
- # redirect_to tag_path(:name => params[:name])
- # end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement