Module: ActionPushWeb::ApplicationHelper
- Defined in:
- app/helpers/action_push_web/application_helper.rb
Instance Method Summary collapse
- #ask_for_web_notifications(**attrs, &block) ⇒ Object
- #when_web_notifications_allowed(href: action_push_web.subscriptions_path, service_worker_url: pwa_service_worker_path(format: :js), application: nil, **attrs, &block) ⇒ Object
- #when_web_notifications_disabled(**attrs, &block) ⇒ Object
Instance Method Details
#ask_for_web_notifications(**attrs, &block) ⇒ Object
14 15 16 |
# File 'app/helpers/action_push_web/application_helper.rb', line 14 def ask_for_web_notifications(**attrs, &block) content_tag("action-push-web-request", capture(&block), **attrs) end |
#when_web_notifications_allowed(href: action_push_web.subscriptions_path, service_worker_url: pwa_service_worker_path(format: :js), application: nil, **attrs, &block) ⇒ Object
7 8 9 10 11 12 |
# File 'app/helpers/action_push_web/application_helper.rb', line 7 def when_web_notifications_allowed(href: action_push_web.subscriptions_path, service_worker_url: pwa_service_worker_path(format: :js), application: nil, **attrs, &block) content_tag("action-push-web-granted", capture(&block), href:, "service-worker-url" => service_worker_url, "public-key" => ActionPushWeb.config_for(application)[:public_key], **attrs) end |
#when_web_notifications_disabled(**attrs, &block) ⇒ Object
3 4 5 |
# File 'app/helpers/action_push_web/application_helper.rb', line 3 def when_web_notifications_disabled(**attrs, &block) content_tag("action-push-web-denied", capture(&block), **attrs) end |