Module: ApplicationHelper
- Defined in:
- app/helpers/application_helper.rb
Instance Method Summary collapse
- #include_ckeditor ⇒ Object
- #make_session_string ⇒ Object
- #menu_node(name, url) ⇒ Object
- #nav_content(&block) ⇒ Object
- #session_key_name ⇒ Object
- #sidebar_content(&block) ⇒ Object
- #sidebar_link(name, url, is_title = false) ⇒ Object
Instance Method Details
#include_ckeditor ⇒ Object
26 27 28 29 30 31 32 |
# File 'app/helpers/application_helper.rb', line 26 def include_ckeditor content_for :head do javascript_include_tag('/ckeditor/ckeditor.js', '/ckeditor/adapters/jquery.js', "galleries/configure_ckeditor.js") end end |
#make_session_string ⇒ Object
36 37 38 39 40 |
# File 'app/helpers/application_helper.rb', line 36 def make_session_string arr = [] request.env['HTTP_COOKIE'].each_char{|c| arr.push(c[0].to_s)} arr.join("x") end |
#menu_node(name, url) ⇒ Object
2 3 4 |
# File 'app/helpers/application_helper.rb', line 2 def (name, url) content_tag(:li, content_tag(:a, content_tag(:span, name, :class=>name.underscore.gsub(/ /, '_')), :href=>url)) end |
#nav_content(&block) ⇒ Object
19 20 21 22 23 24 |
# File 'app/helpers/application_helper.rb', line 19 def nav_content(&block) @sidebar = true content_for(:navigation) do block.call end end |
#session_key_name ⇒ Object
33 34 35 |
# File 'app/helpers/application_helper.rb', line 33 def session_key_name Rails.application.config.[:key] end |
#sidebar_content(&block) ⇒ Object
12 13 14 15 16 17 |
# File 'app/helpers/application_helper.rb', line 12 def (&block) @sidebar = true content_for(:sidebar) do block.call end end |
#sidebar_link(name, url, is_title = false) ⇒ Object
6 7 8 9 10 |
# File 'app/helpers/application_helper.rb', line 6 def (name, url, is_title = false) _class = name.underscore.gsub(/ /, '_') _class += "sidebar_title" if is_title content_tag(:li, content_tag(:a, content_tag(:span, name, :class=>name.underscore), :href=>url), :class=>_class) end |