Sha256: e8ff22e0cf1446a070cd480c12a704749dc4d1124be0ebf3a9cb910ffffb91c1

Contents?: true

Size: 491 Bytes

Versions: 9

Compression:

Stored size: 491 Bytes

Contents

require 'uv'
module BrighterPlanetHelper
  def render_or_nothing(*args)
    begin
      render(*args)
    rescue ::ActionView::MissingTemplate
      nil
    end
  end

  def syntax(code, lang = 'ruby')
    ::Uv.parse(code, 'xhtml', lang, false, :idle).html_safe
  end
  
  def link_to_homesite(text, path = '')
    path.insert 0, 'http://brighterplanet.com/' unless ::BrighterPlanetLayout.application_name == 'Brighter Planet'
    path << '/' if path.empty?
    link_to text, path
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
brighter_planet_layout-0.2.29 app/helpers/brighter_planet_helper.rb
brighter_planet_layout-0.2.28 app/helpers/brighter_planet_helper.rb
brighter_planet_layout-0.2.27 app/helpers/brighter_planet_helper.rb
brighter_planet_layout-0.2.26 app/helpers/brighter_planet_helper.rb
brighter_planet_layout-0.2.25 app/helpers/brighter_planet_helper.rb
brighter_planet_layout-0.2.24 app/helpers/brighter_planet_helper.rb
brighter_planet_layout-0.2.23 app/helpers/brighter_planet_helper.rb
brighter_planet_layout-0.2.22 app/helpers/brighter_planet_helper.rb
brighter_planet_layout-0.2.21 app/helpers/brighter_planet_helper.rb