Sha256: d2c2f337488162f6c5c6b54c08df02e9d6fbf87b4814f235848c4e01c985189c

Contents?: true

Size: 525 Bytes

Versions: 15

Compression:

Stored size: 525 Bytes

Contents

module NavHelper

	def nav_link(page, &link_text) 
		class_name = request.env['PATH_INFO'].match(page) ? 'active' : nil

		content_tag(:li, class: class_name) do
			link_to page do
				link_text.call
			end
		end

	end

	def treeview_link(text, &links)
		content = link_to('#') do
			content_tag(:span, text) <<
			content_tag(:i, '', class: "fa pull-right fa-angle-left")
		end

		content << content_tag(:ul, class: 'treeview-menu') do 
			links.call
		end

		content_tag :li, class: 'treeview' do
			content
		end
	end

end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
phcmembers-2.2.0 app/helpers/nav_helper.rb
phcmembers-2.1.3 app/helpers/nav_helper.rb
phcmembers-2.1.2 app/helpers/nav_helper.rb
phcmembers-2.1.1 app/helpers/nav_helper.rb
phcmembers-2.1.0 app/helpers/nav_helper.rb
phcmembers-2.0.0 app/helpers/nav_helper.rb
phcmembers-1.9.9 app/helpers/nav_helper.rb
phcmembers-1.9.5 app/helpers/nav_helper.rb
phcmembers-1.9.0 app/helpers/nav_helper.rb
phcmembers-1.8.1 app/helpers/nav_helper.rb
phcmembers-1.8.0 app/helpers/nav_helper.rb
phcmembers-1.7.8 app/helpers/nav_helper.rb
phcmembers-1.7.6 app/helpers/nav_helper.rb
phcmembers-1.7.5 app/helpers/nav_helper.rb
phcmembers-1.7.0 app/helpers/nav_helper.rb