Class: Publinator::ApplicationController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- Publinator::ApplicationController
show all
- Defined in:
- app/controllers/publinator/application_controller.rb
Instance Method Summary
collapse
Instance Method Details
#body_id ⇒ Object
34
35
36
37
38
39
40
41
42
43
44
|
# File 'app/controllers/publinator/application_controller.rb', line 34
def body_id
if @section
return @section.slug
elsif @page
return @page.section.slug
elsif @publishable
return @publishable.class.to_s.downcase
else
return "home"
end
end
|
#current_controller ⇒ Object
29
30
31
32
|
# File 'app/controllers/publinator/application_controller.rb', line 29
def current_controller
return "Home" if body_id == 'home'
body_id.pluralize.camelize
end
|
#current_domain ⇒ Object
12
13
14
|
# File 'app/controllers/publinator/application_controller.rb', line 12
def current_domain
@current_domain ||= DomainName.get_by_domain_name(request)
end
|
#current_layout ⇒ Object
16
17
18
19
20
21
22
|
# File 'app/controllers/publinator/application_controller.rb', line 16
def current_layout
if current_site.nil?
"publinator/publinator"
else
@current_layout ||= current_site.layout
end
end
|
#current_site ⇒ Object
7
8
9
10
|
# File 'app/controllers/publinator/application_controller.rb', line 7
def current_site
return nil if current_domain.nil?
@current_site ||= current_domain.site
end
|
#current_site_name ⇒ Object
24
25
26
27
|
# File 'app/controllers/publinator/application_controller.rb', line 24
def current_site_name
return "Publinator" if current_site.nil?
@current_site_name ||= current_site.name
end
|