Permalink
Browse files

allow only creation and destruction, redirct back

  • Loading branch information...
1 parent 50fb106 commit 9a6f4c4bfd5581c341b0e1e58bac80f407301585 @swistak swistak committed Jul 6, 2009
Showing with 11 additions and 1 deletion.
  1. +11 −1 app/controllers/subscriptions_controller.rb
@@ -3,5 +3,15 @@
class SubscriptionsController < Spree::BaseController
resource_controller
- actions :all, :only => [:create, :update, :destroy]
+ actions :all, :only => [:create, :destroy]
+
+ create.after do
+ flash[:notice] = I18n.t(:subscribed)
+ redirect_to :back
+ end
+
+ destroy.after do
+ flash[:notice] = I18n.t(:unsubscribed)
+ redirect_to :back
+ end
end

0 comments on commit 9a6f4c4

Please sign in to comment.