diff --git a/app/controllers/tag_subscriptions_controller.rb b/app/controllers/tag_subscriptions_controller.rb index 2396bdc94..8de447389 100644 --- a/app/controllers/tag_subscriptions_controller.rb +++ b/app/controllers/tag_subscriptions_controller.rb @@ -23,7 +23,7 @@ class TagSubscriptionsController < ApplicationController def create @tag_subscription = TagSubscription.create(params[:tag_subscription]) - respond_with(@tag_subscription) + respond_with(@tag_subscription, :location => tag_subscriptions_path) end def update diff --git a/app/models/tag_subscription.rb b/app/models/tag_subscription.rb index 53df2302e..7d300c6d9 100644 --- a/app/models/tag_subscription.rb +++ b/app/models/tag_subscription.rb @@ -4,7 +4,7 @@ class TagSubscription < ActiveRecord::Base before_validation :initialize_post_ids, :on => :create before_save :normalize_name before_save :limit_tag_count - attr_accessible :name, :tag_query, :post_ids, :is_visible_on_profile + attr_accessible :name, :tag_query, :post_ids, :is_public, :is_visible_on_profile validates_presence_of :name, :tag_query, :is_public, :creator_id def normalize_name @@ -42,6 +42,10 @@ class TagSubscription < ActiveRecord::Base user.is_moderator? || creator_id == user.id end + def post_id_array + post_ids.split(/,/) + end + def self.search(params) q = scoped return q if params.blank? diff --git a/app/views/tag_subscriptions/index.html.erb b/app/views/tag_subscriptions/index.html.erb index cc8d132f3..c91e11320 100644 --- a/app/views/tag_subscriptions/index.html.erb +++ b/app/views/tag_subscriptions/index.html.erb @@ -7,14 +7,23 @@