Class: Decidim::NewslettersOptInController
- Inherits:
-
ApplicationController
- Object
- DecidimController
- ApplicationController
- Decidim::NewslettersOptInController
- Includes:
- FormFactory
- Defined in:
- app/controllers/decidim/newsletters_opt_in_controller.rb
Overview
The controller to control newsletter Opt-in for GDPR
Instance Method Summary collapse
Methods included from UserBlockedChecker
#check_user_block_status, #check_user_not_blocked
Methods included from NeedsSnippets
Methods included from HttpCachingDisabler
Methods included from HasStoredPath
#skip_store_location?, #store_current_location
Methods included from RegistersPermissions
Methods included from NeedsOrganization
enhance_controller, extended, included
Instance Method Details
#update ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'app/controllers/decidim/newsletters_opt_in_controller.rb', line 10 def update :update, :user, current_user: current_user current_user. if current_user.save flash[:notice] = t(".success") else flash[:alert] = t(".error") end redirect_to decidim.root_path(host: current_organization) end |