aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/subscriptions_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/subscriptions_controller.rb')
-rw-r--r--app/controllers/subscriptions_controller.rb20
1 files changed, 7 insertions, 13 deletions
diff --git a/app/controllers/subscriptions_controller.rb b/app/controllers/subscriptions_controller.rb
index e860e94ec..a1dca5a5d 100644
--- a/app/controllers/subscriptions_controller.rb
+++ b/app/controllers/subscriptions_controller.rb
@@ -1,18 +1,12 @@
-class SubscriptionsController < Devise::RegistrationsController
+class SubscriptionsController < InheritedResources::Base
+ skip_filter :authenticate_user!
- def new
- @subscription = Subscription.new
- end
def create
- @subscription = Subscription.new(params[:subscription])
-
- if @subscription.save
- sign_in @subscription.user
- flash[:notice] = t('subscriptions.success')
- redirect_to referentials_path
- else
- flash[:error] = t('subscriptions.failure')
- render :action => "new"
+ create! do |success, failure|
+ success.html do
+ sign_in resource.user
+ redirect_to referentials_path
+ end
end
end