Module: Goldencobra::ApplicationHelper

Includes:
ArticlesHelper, LoginHelper, NavigationHelper
Defined in:
app/helpers/goldencobra/application_helper.rb

Instance Method Summary collapse

Methods included from LoginHelper

#render_login_widget, #render_registration_widget

Methods included from NavigationHelper

#breadcrumb, #navigation_menu

Methods included from ArticlesHelper

#index_of_articles, #parse_glossar_entries, #read_on, #render_article_content_parts, #render_article_image_gallery, #render_article_type_content, #render_article_widgets

Instance Method Details

#application_routesUrlHelpers

Named routes outside mounted rails engine You can call any named route defined in your railsapp inside a goldencobra_view by calling:

<%= link_to “CustomRoute”, application_routes.custom_page_path() %>

Returns:

  • (UrlHelpers)


40
41
42
# File 'app/helpers/goldencobra/application_helper.rb', line 40

def application_routes
  Rails.application.routes.url_helpers
end

#basic_goldencobra_headers(options = {}) ⇒ Object



28
29
30
# File 'app/helpers/goldencobra/application_helper.rb', line 28

def basic_goldencobra_headers(options={})
  render partial: "/goldencobra/articles/headers", locals: {options: options}
end

#bugtrackerObject



15
16
17
18
19
20
21
22
# File 'app/helpers/goldencobra/application_helper.rb', line 15

def bugtracker
  user_mod = Goldencobra::Setting.for_key("goldencobra.bugherd.user")
  role_mod = Goldencobra::Setting.for_key("goldencobra.bugherd.role")
  bugherd_api = Goldencobra::Setting.for_key("goldencobra.bugherd.api")
  if bugherd_api.present? && user_mod.present? && role_mod.present? && eval("!defined?(#{user_mod}).nil? && #{user_mod} && #{user_mod}.present? && #{user_mod}.has_role?('#{role_mod}')")
    render partial: "goldencobra/articles/bugherd", locals: {bugherd_api: bugherd_api}
  end
end

#edit_article_linkObject



24
25
26
# File 'app/helpers/goldencobra/application_helper.rb', line 24

def edit_article_link
  render partial: "goldencobra/articles/edit_article_link"
end

#s(name) ⇒ Object



9
10
11
12
13
# File 'app/helpers/goldencobra/application_helper.rb', line 9

def s(name)
  if name.present?
    Goldencobra::Setting.for_key(name)
  end
end