Class: Decidim::OpenDataController
- Inherits:
-
ApplicationController
- Object
- DecidimController
- ApplicationController
- Decidim::OpenDataController
- Defined in:
- decidim-core/app/controllers/decidim/open_data_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
Methods included from UserBlockedChecker
#check_user_block_status, #check_user_not_blocked
Methods included from NeedsSnippets
Methods included from Headers::HttpCachingDisabler
Methods included from HasStoredPath
#skip_store_location?, #store_current_location
Methods included from TranslatableAttributes
#attachment?, #default_locale?
Methods included from RegistersPermissions
Methods included from NeedsOrganization
enhance_controller, extended, included
Instance Method Details
#download ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'decidim-core/app/controllers/decidim/open_data_controller.rb', line 9 def download resource = params[:resource] || nil if open_data_file_for_resource(resource) file = open_data_file_for_resource(resource) send_data file.download, filename: file.blob.filename.to_s, type: file.blob.content_type else schedule_open_data_generation(resource) flash[:alert] = t("decidim.open_data.not_available_yet") redirect_back fallback_location: open_data_path end end |
#index ⇒ Object
7 |
# File 'decidim-core/app/controllers/decidim/open_data_controller.rb', line 7 def index; end |