Class: Decidim::QrController
- Inherits:
-
ApplicationController
- Object
- DecidimController
- ApplicationController
- Decidim::QrController
- Includes:
- OrganizationHelper, QrCodeHelper
- Defined in:
- decidim-core/app/controllers/decidim/qr_controller.rb
Instance Method Summary collapse
-
#current_component ⇒ Object
needs to be public so that short link works.
-
#current_participatory_space ⇒ Object
needs to be public so that short link works.
- #show ⇒ Object
Methods included from QrCodeHelper
#local_params, #qr_code, #qr_code_image, #resource_name, #resource_url
Methods included from ShortLinkHelper
Methods included from OrganizationHelper
#current_organization_name, #organization_colors, #organization_description_label, #organization_name
Methods included from TranslatableAttributes
#attachment?, #default_locale?
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 RegistersPermissions
Methods included from NeedsOrganization
enhance_controller, extended, included
Instance Method Details
#current_component ⇒ Object
needs to be public so that short link works
25 |
# File 'decidim-core/app/controllers/decidim/qr_controller.rb', line 25 def current_component = resource.try(:component) |
#current_participatory_space ⇒ Object
needs to be public so that short link works
28 29 30 31 32 |
# File 'decidim-core/app/controllers/decidim/qr_controller.rb', line 28 def current_participatory_space return resource if resource.is_a?(Decidim::Participable) resource.try(:participatory_space) end |
#show ⇒ Object
17 18 19 20 21 22 |
# File 'decidim-core/app/controllers/decidim/qr_controller.rb', line 17 def show respond_to do |format| format.html format.png { send_data(qr_code.as_png(size: 500), filename: "qr-#{organization_name}-#{parametrized_title}.png") } end end |