Sha256: 6ba0317c9bdc6f0ad669afd7040cefb42e90875375d8b45ecbbb1cc4c50ae332

Contents?: true

Size: 632 Bytes

Versions: 2

Compression:

Stored size: 632 Bytes

Contents

module TitleHelper
	def page_title(text=nil)
		title = text.to_s

		if text.nil?
			if action_name == 'update'
				title = t("page_titles.#{controller_name}.edit")
			end

			if action_name == 'create'
				title = t("page_titles.#{controller_name}.new")
			end

			title = t("page_titles.#{controller_name}.#{action_name}", default: title)
		end

		if text.is_a? Symbol
			title = t("page_titles.#{controller_name}.#{text}")
		end

		content_for :title, "<div class=\"page-header\"><h1>#{title}</h1></div>".html_safe
		content_tag :title, "#{"#{title} |" unless title.blank?} #{t :application_title}"
	end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
twitter-bootstrap-for-rails-1.3.4 app/helpers/title_helper.rb
twitter-bootstrap-for-rails-1.3.3 app/helpers/title_helper.rb