Module: PagesCore::ApplicationHelper
- Includes:
- AttachmentsHelper, HeadTagsHelper, ImagesHelper, MetaTagsHelper, OpenGraphTagsHelper, PagePathHelper
- Included in:
- ApplicationHelper, FrontendController
- Defined in:
- app/helpers/pages_core/application_helper.rb
Instance Method Summary collapse
Methods included from PagePathHelper
Methods included from OpenGraphTagsHelper
#open_graph_properties, #open_graph_tags
Methods included from MetaTagsHelper
#default_meta_image, #default_meta_image?, #meta_description, #meta_description?, #meta_image, #meta_image?, #meta_keywords, #meta_keywords?
Methods included from ImagesHelper
#dynamic_image_tag, #original_dynamic_image_tag, #uncropped_dynamic_image_tag
Methods included from HeadTagsHelper
#document_title, #document_title?, #feed_tags, #google_analytics_tags, #head_tag, #rss_link_tag, #typekit_tags
Methods included from AttachmentsHelper
#attachment_path, #download_attachment_path, #page_file_path
Instance Method Details
#page_link(page, options = {}) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'app/helpers/pages_core/application_helper.rb', line 14 def page_link(page, = {}) link_locale = [:locale] || locale page.localize(link_locale) do |p| title = [:title] || p.name.to_s return title unless () link_to(title, page_link_path(link_locale, p), class: [:class]) end end |
#unique_page(page_name, &block) ⇒ Object
24 25 26 27 28 29 30 31 32 |
# File 'app/helpers/pages_core/application_helper.rb', line 24 def unique_page(page_name, &block) locale = @locale || I18n.default_locale.to_s page = Page.where(unique_name: page_name).first if page && block_given? output = capture(page.localize(locale), &block) concat(output) end page ? page.localize(locale) : nil end |