Module: SlackSignIn::LinkHelper
- Defined in:
- app/helpers/slack_sign_in/link_helper.rb
Instance Method Summary collapse
- #slack_sign_in_image ⇒ Object
- #slack_sign_in_link(text = nil, proceed_to:, **options, &block) ⇒ Object
Instance Method Details
#slack_sign_in_image ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'app/helpers/slack_sign_in/link_helper.rb', line 15 def slack_sign_in_image image_tag( "https://platform.slack-edge.com/img/sign_in_with_slack.png", alt: "Sign in with Slack", height: 40, width: 172, srcset: { "https://platform.slack-edge.com/img/sign_in_with_slack.png" => "1x", "https://platform.slack-edge.com/img/[email protected]" => "2x", }, ) end |
#slack_sign_in_link(text = nil, proceed_to:, **options, &block) ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 |
# File 'app/helpers/slack_sign_in/link_helper.rb', line 2 def slack_sign_in_link(text = nil, proceed_to:, **, &block) = .merge(method: :post) auth_url = slack_sign_in.(proceed_to: proceed_to) if text link_to(text, auth_url, ) elsif block_given? link_to(auth_url, , &block) else link_to(auth_url, ) { slack_sign_in_image } end end |