class Locomotive::Steam::Liquid::Tags::RedirectTo

Public Instance Methods

render(context) click to toggle source
# File lib/locomotive/steam/liquid/tags/redirect_to.rb, line 12
def render(context)
  if (path = render_path(context)).present?
    # 301 or 302 redirection
    is_permanent = attributes[:permanent].nil? ? true : attributes[:permanent]

    # break the rendering process
    raise Locomotive::Steam::RedirectionException.new(path, permanent: is_permanent)
  end
  ''
end
wrong_syntax!() click to toggle source
# File lib/locomotive/steam/liquid/tags/redirect_to.rb, line 23
def wrong_syntax!
  raise SyntaxError.new("Valid syntax: redirect_to <page|page_handle|content_entry|external_url>(, locale: [fr|de|...], with: <page_handle>, permanent: [true|false]")
end