Module: EventsHelper

Defined in:
app/helpers/events_helper.rb

Instance Method Summary collapse

Instance Method Details



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

def breadcrumbs(*groups)
  breadcrumbs = ""
  groups.each do |group|
    breadcrumbs << "<div class='breadcrumb_divider'></div>"
    if groups.last == group
      breadcrumbs << "<a class='current'>#{group.first}</a>"
    else
      breadcrumbs << link_to(group.first, group.last)
    end
  end
  breadcrumbs.html_safe
end

#detail_table(detail) ⇒ Object



12
13
14
# File 'app/helpers/events_helper.rb', line 12

def detail_table(detail)
  render :partial => 'events/detail', :object => detail
end

#format_detail(detail) ⇒ Object



2
3
4
5
6
7
8
9
10
# File 'app/helpers/events_helper.rb', line 2

def format_detail(detail)
  case detail
  when String, Numeric then detail
  when Array           then "<ul class='array'>#{detail.collect{|d| "<li>- #{format_detail(d)}</li>" }.join}</ul>".html_safe
  when Hash            then detail_table(detail)
  else
    detail.to_s.html_safe
  end
end