Skip to content
darthapo edited this page Jul 4, 2012 · 2 revisions

Default Helpers

(document these:)

markdown

textile

hidden

Adding Your Own Helpers

In your Gumdrop file:

Gumdrop.view_helpers do

  def say_hi_to(person)
    "Hello, #{ person }!"
  end

  # Calculate the years for a copyright
  def copyright_years(start_year, divider="–")
    end_year = Date.today.year
    if start_year == end_year
      "#{start_year}"
    else
      "#{start_year}#{divider}#{end_year}"
    end
  end

end

Clone this wiki locally