Sha256: 8ef74d9d73a760fb21426b2a9363019c88132fbcad3ab07b60c44e3a00f6e564

Contents?: true

Size: 766 Bytes

Versions: 1

Compression:

Stored size: 766 Bytes

Contents

module EventsHelper
  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
    end
  end
  
  def detail_table(detail)
    render :partial => 'events/detail', :object => detail
  end

  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
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
whoops-0.5.3 app/helpers/events_helper.rb