Module: Pontiac::ApplicationHelper

Included in:
ApplicationController
Defined in:
app/helpers/pontiac/application_helper.rb

Instance Method Summary collapse

Instance Method Details

#authenticate_shop!Object



3
4
5
# File 'app/helpers/pontiac/application_helper.rb', line 3

def authenticate_shop!
  redirect_to main_app.root_path unless signed_in?
end

#current_shopObject



11
12
13
# File 'app/helpers/pontiac/application_helper.rb', line 11

def current_shop
  @current_shop ||= (cookies.signed[:shop_id] && Shop.find_by_id(cookies.signed[:shop_id]))
end

#shop_urlObject



15
16
17
# File 'app/helpers/pontiac/application_helper.rb', line 15

def shop_url
  "http://#{current_shop.fwm_domain}"
end

#signed_in?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'app/helpers/pontiac/application_helper.rb', line 7

def signed_in?
  !current_shop.nil?
end