Module: Alchemy::UrlHelper
- Included in:
- ElementsHelper
- Defined in:
- app/helpers/alchemy/url_helper.rb
Instance Method Summary collapse
-
#download_alchemy_attachment_path(attachment) ⇒ Object
Returns the path for downloading an alchemy attachment.
-
#download_alchemy_attachment_url(attachment) ⇒ Object
Returns the url for downloading an alchemy attachment.
-
#show_alchemy_page_path(page, optional_params = {}) ⇒ Object
Returns the path for rendering an alchemy page.
-
#show_alchemy_page_url(page, optional_params = {}) ⇒ Object
Returns the url for rendering an alchemy page.
-
#show_page_path_params(page, optional_params = {}) ⇒ Object
Returns the correct params-hash for passing to show_page_path.
Instance Method Details
#download_alchemy_attachment_path(attachment) ⇒ Object
Returns the path for downloading an alchemy attachment
28 29 30 |
# File 'app/helpers/alchemy/url_helper.rb', line 28 def () alchemy.(, .slug) end |
#download_alchemy_attachment_url(attachment) ⇒ Object
Returns the url for downloading an alchemy attachment
33 34 35 |
# File 'app/helpers/alchemy/url_helper.rb', line 33 def () alchemy.(, .slug) end |
#show_alchemy_page_path(page, optional_params = {}) ⇒ Object
Returns the path for rendering an alchemy page
10 11 12 |
# File 'app/helpers/alchemy/url_helper.rb', line 10 def show_alchemy_page_path(page, optional_params = {}) alchemy.show_page_path(show_page_path_params(page, optional_params)) end |
#show_alchemy_page_url(page, optional_params = {}) ⇒ Object
Returns the url for rendering an alchemy page
15 16 17 |
# File 'app/helpers/alchemy/url_helper.rb', line 15 def show_alchemy_page_url(page, optional_params = {}) alchemy.show_page_url(show_page_path_params(page, optional_params)) end |
#show_page_path_params(page, optional_params = {}) ⇒ Object
Returns the correct params-hash for passing to show_page_path
20 21 22 23 24 25 |
# File 'app/helpers/alchemy/url_helper.rb', line 20 def show_page_path_params(page, optional_params = {}) raise ArgumentError, "Page is nil" if page.nil? url_params = {urlname: page.urlname}.update(optional_params) prefix_locale?(page.language_code) ? url_params.update(locale: page.language_code) : url_params end |