This commit is contained in:
albert
2013-03-11 13:25:34 -04:00
parent c5ce14ac68
commit 17f1069719
6 changed files with 32 additions and 6 deletions

View File

@@ -23,14 +23,30 @@ class TagSubscriptionsController < ApplicationController
def create
@tag_subscription = TagSubscription.create(params[:tag_subscription])
respond_with(@tag_subscription, :location => tag_subscriptions_path)
respond_with(@tag_subscription) do |format|
format.html do
if @tag_subscription.errors.any?
render :action => "new"
else
redirect_to tag_subscriptions_path
end
end
end
end
def update
@tag_subscription = TagSubscription.find(params[:id])
check_privilege(@tag_subscription)
@tag_subscription.update_attributes(params[:tag_subscription])
respond_with(@tag_subscription, :location => tag_subscriptions_path)
respond_with(@tag_subscription) do |format|
format.html do
if @tag_subscription.errors.any?
render :action => "edit"
else
redirect_to tag_subscriptions_path
end
end
end
end
def destroy