Class: Locomotive::Steam::Liquid::Tags::RedirectTo
Constant Summary
Concerns::Path::Syntax
Instance Attribute Summary
#handle
#attributes, #raw_attributes
Instance Method Summary
collapse
#initialize, #render_path
#change_page_locale
Instance Method Details
#render(context) ⇒ Object
12
13
14
15
16
17
18
19
20
21
|
# File 'lib/locomotive/steam/liquid/tags/redirect_to.rb', line 12
def render(context)
if (path = render_path(context)).present?
is_permanent = attributes[:permanent].nil? ? true : attributes[:permanent]
raise Locomotive::Steam::RedirectionException.new(path, permanent: is_permanent)
end
''
end
|
#wrong_syntax! ⇒ Object
23
24
25
|
# 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
|