Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

allow only creation and destruction, redirct back

  • Loading branch information...
commit 9a6f4c4bfd5581c341b0e1e58bac80f407301585 1 parent 50fb106
@swistak swistak authored
Showing with 11 additions and 1 deletion.
  1. +11 −1 app/controllers/subscriptions_controller.rb
View
12 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
Please sign in to comment.
Something went wrong with that request. Please try again.