Module: EffectivePermalinksHelper

Defined in:
app/helpers/effective_permalinks_helper.rb

Instance Method Summary collapse

Instance Method Details



9
10
11
12
13
14
15
16
17
18
# File 'app/helpers/effective_permalinks_helper.rb', line 9

def permalink_to(permalink_or_slug, options = {})
  permalink =
    if permalink_or_slug.kind_of?(String)
      Effective::Permalink.find_by(slug: slug)
    else
      permalink_or_slug
    end

  link_to permalink, permalink.redirect_path, options
end


5
6
7
# File 'app/helpers/effective_permalinks_helper.rb', line 5

def permalinks
  @_effective_permalinks ||= Effective::Permalink.deep.order(:id)
end