Class: Decidim::TosController
- Inherits:
-
ApplicationController
- Object
- DecidimController
- ApplicationController
- Decidim::TosController
- Defined in:
- app/controllers/decidim/tos_controller.rb
Overview
The controller to handle the current user’s Terms and Conditions agreement.
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
#accept_tos ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'app/controllers/decidim/tos_controller.rb', line 9 def accept_tos current_user.accepted_tos_version = Time.current if current_user.save! flash[:notice] = t("accept.success", scope: "decidim.pages.terms_and_conditions") redirect_to after_sign_in_path_for current_user else flash[:alert] = t("accept.error", scope: "decidim.pages.terms_and_conditions") redirect_to decidim.page_path tos_page end end |