Class: Aven::Views::Oauth::Error::Component

Inherits:
ApplicationViewComponent show all
Defined in:
app/components/aven/views/oauth/error/component.rb

Instance Method Summary collapse

Methods inherited from ApplicationViewComponent

#controller_name

Instance Method Details

#home_pathObject



22
23
24
25
26
27
28
# File 'app/components/aven/views/oauth/error/component.rb', line 22

def home_path
  if helpers.respond_to?(:main_app) && helpers.main_app.respond_to?(:root_path)
    helpers.main_app.root_path
  else
    Aven::Engine.routes.url_helpers.root_path
  end
end

#oauth_path_for(provider) ⇒ Object



11
12
13
14
15
16
17
18
19
20
# File 'app/components/aven/views/oauth/error/component.rb', line 11

def oauth_path_for(provider)
  case provider.to_sym
  when :github
    Aven::Engine.routes.url_helpers.oauth_github_path
  when :google
    Aven::Engine.routes.url_helpers.oauth_google_path
  else
    "#"
  end
end


7
8
9
# File 'app/components/aven/views/oauth/error/component.rb', line 7

def provider_links
  Aven.configuration.oauth_providers.keys
end