Module: ApplicationHelper

Includes:
ScaffoldLogic::FormHelper, ScaffoldLogic::Helper, ScaffoldLogic::MenuHelper, ScaffoldLogic::TabInterfaceHelper
Defined in:
app/helpers/application_helper.rb

Instance Method Summary collapse

Instance Method Details

#admin_breadcrumbsObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'app/helpers/application_helper.rb', line 7

def admin_breadcrumbs
  html = %{<ol class="breadcrumbs">}

  # Top-level
  html << (:li, link_to('Home', '/'))

  # Secondary

  # Tidy up
  html << %{</ol>}

  # Output that puppy.
  html.html_safe

end


23
24
25
26
27
28
29
# File 'app/helpers/application_helper.rb', line 23

def breadcrumbs
  unless controller?('home') && action?(/home|index/)
    html = [ link_to('Home', root_path) ]
#      html << link_to( 'Foo', foo_path ) if controller?('FoosController')
    (html * ' &gt; ').html_safe
  end
end

#set_title(title = nil, window_title = nil) ⇒ Object



31
32
33
34
35
36
37
38
39
40
41
# File 'app/helpers/application_helper.rb', line 31

def set_title(title = nil, window_title = nil)
  app_name ||= 'SEO Logic'
  window_title ||= title
  if title.nil?
    content_for(:title) { app_name }
    content_for(:page_title) {  }
  else
    content_for(:title) { window_title + " - #{app_name}" }
    content_for(:page_title) { title }
  end
end