Module: Clavis::ViewHelpers
- Defined in:
- lib/clavis/view_helpers.rb
Instance Method Summary collapse
-
#clavis_oauth_button(provider, options = {}) ⇒ String
Generates an OAuth button for the specified provider.
Instance Method Details
#clavis_oauth_button(provider, options = {}) ⇒ String
Generates an OAuth button for the specified provider
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/clavis/view_helpers.rb', line 16 def (provider, = {}) provider = provider.to_sym # Default options = { text: (provider), class: (provider), icon: (provider), icon_class: clavis_default_icon_class(provider), method: :get, html: {} }.merge() # More aggressive Turbo disabling - ensure it works in all environments [:html] ||= {} [:html]["data-turbo"] = "false" [:html]["data-turbo-frame"] = "_top" [:html]["rel"] = "nofollow" # Generate the button with a direct path to the auth endpoint clavis_link_to( (provider, ), (provider), method: [:method], class: [:class], **[:html] ).html_safe end |