Class: Decidim::DataPortabilityController
- Inherits:
-
ApplicationController
- Object
- DecidimController
- ApplicationController
- Decidim::DataPortabilityController
- Includes:
- UserProfile
- Defined in:
- app/controllers/decidim/data_portability_controller.rb
Overview
The controller to handle the user’s download_my_data page.
Instance Method Summary collapse
Methods included from UserProfile
#available_verification_workflows
Methods included from UserGroups
Methods included from NeedsSnippets
Methods included from HttpCachingDisabler
Methods included from RegistersPermissions
Methods included from NeedsOrganization
enhance_controller, extended, included
Instance Method Details
#download_file ⇒ Object
25 26 27 28 29 30 31 32 33 34 |
# File 'app/controllers/decidim/data_portability_controller.rb', line 25 def download_file :download, :user, current_user: current_user if data_portability_file_exists? redirect_to uploader.url else flash[:error] = t("decidim.account.data_portability_export.file_no_exists") redirect_to data_portability_path end end |
#export ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'app/controllers/decidim/data_portability_controller.rb', line 16 def export :export, :user, current_user: current_user DataPortabilityExportJob.perform_later(current_user) flash[:notice] = t("decidim.account.data_portability_export.notice") redirect_back(fallback_location: data_portability_path) end |
#show ⇒ Object
10 11 12 13 14 |
# File 'app/controllers/decidim/data_portability_controller.rb', line 10 def show :show, :user, current_user: current_user @account = form(AccountForm).from_model(current_user) end |