Module: SlackSignIn::LinkHelper

Defined in:
app/helpers/slack_sign_in/link_helper.rb

Instance Method Summary collapse

Instance Method Details

#slack_sign_in_imageObject



15
16
17
18
19
20
21
22
23
24
25
26
# File 'app/helpers/slack_sign_in/link_helper.rb', line 15

def 
  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


2
3
4
5
6
7
8
9
10
11
12
13
# File 'app/helpers/slack_sign_in/link_helper.rb', line 2

def (text = nil, proceed_to:, **options, &block)
  options = options.merge(method: :post)
  auth_url = .authorization_path(proceed_to: proceed_to)

  if text
    link_to(text, auth_url, options)
  elsif block_given?
    link_to(auth_url, options, &block)
  else
    link_to(auth_url, options) {  }
  end
end