Sha256: 70709293afdd07b861a94c54216aac001d885d7858d5e9666fda7f3d6943ceae

Contents?: true

Size: 716 Bytes

Versions: 54

Compression:

Stored size: 716 Bytes

Contents

module CurationConcerns::TitleHelper
  def application_name
    t('curation_concerns.product_name', default: super)
  end

  def construct_page_title(*elements)
    (elements.flatten.compact + [application_name]).join(' // ')
  end

  def curation_concern_page_title(curation_concern)
    if curation_concern.persisted?
      construct_page_title(curation_concern.to_s, "#{curation_concern.human_readable_type} [#{curation_concern.to_param}]")
    else
      construct_page_title("New #{curation_concern.human_readable_type}")
    end
  end

  def default_page_title
    text = controller_name.singularize.titleize
    text = "#{action_name.titleize} " + text if action_name
    construct_page_title(text)
  end
end

Version data entries

54 entries across 54 versions & 1 rubygems

Version Path
curation_concerns-1.3.2 app/helpers/curation_concerns/title_helper.rb
curation_concerns-1.3.1 app/helpers/curation_concerns/title_helper.rb
curation_concerns-1.3.0 app/helpers/curation_concerns/title_helper.rb
curation_concerns-1.2.0 app/helpers/curation_concerns/title_helper.rb
curation_concerns-1.1.2 app/helpers/curation_concerns/title_helper.rb
curation_concerns-1.1.1 app/helpers/curation_concerns/title_helper.rb
curation_concerns-1.1.0 app/helpers/curation_concerns/title_helper.rb
curation_concerns-1.0.0 app/helpers/curation_concerns/title_helper.rb
curation_concerns-1.0.0.beta10 app/helpers/curation_concerns/title_helper.rb
curation_concerns-1.0.0.beta9 app/helpers/curation_concerns/title_helper.rb
curation_concerns-1.0.0.beta8 app/helpers/curation_concerns/title_helper.rb
curation_concerns-1.0.0.beta7 app/helpers/curation_concerns/title_helper.rb
curation_concerns-1.0.0.beta6 app/helpers/curation_concerns/title_helper.rb
curation_concerns-1.0.0.beta5 app/helpers/curation_concerns/title_helper.rb
curation_concerns-1.0.0.beta4 app/helpers/curation_concerns/title_helper.rb
curation_concerns-1.0.0.beta3 app/helpers/curation_concerns/title_helper.rb
curation_concerns-1.0.0.beta2 app/helpers/curation_concerns/title_helper.rb
curation_concerns-1.0.0.beta1 app/helpers/curation_concerns/title_helper.rb
curation_concerns-0.14.0 app/helpers/curation_concerns/title_helper.rb
curation_concerns-0.14.0.pre4 app/helpers/curation_concerns/title_helper.rb