Module: CmsHelper
- Defined in:
- app/helpers/cms_helper.rb
Instance Method Summary collapse
- #javascript(*args) ⇒ Object
- #link_to_add_contents(name, f, association) ⇒ Object
- #show_title? ⇒ Boolean
- #stylesheet(*args) ⇒ Object
- #title(page_title, show_title = true) ⇒ Object
Instance Method Details
#javascript(*args) ⇒ Object
22 23 24 |
# File 'app/helpers/cms_helper.rb', line 22 def javascript(*args) content_for(:head) { javascript_include_tag(*args) } end |
#link_to_add_contents(name, f, association) ⇒ Object
2 3 4 5 6 7 8 |
# File 'app/helpers/cms_helper.rb', line 2 def link_to_add_contents(name, f, association) new_object = f.object.class.reflect_on_association(association).klass.new fields = f.fields_for(association, new_object, :child_index => "new_#{association}") do |builder| render(association.to_s.singularize + "_fields", :f => builder) end link_to_function(name, "add_fields(this, \"#{association}\", \"#{escape_javascript(fields)}\")") end |
#show_title? ⇒ Boolean
14 15 16 |
# File 'app/helpers/cms_helper.rb', line 14 def show_title? @show_title end |
#stylesheet(*args) ⇒ Object
18 19 20 |
# File 'app/helpers/cms_helper.rb', line 18 def stylesheet(*args) content_for(:head) { stylesheet_link_tag(*args) } end |
#title(page_title, show_title = true) ⇒ Object
9 10 11 12 |
# File 'app/helpers/cms_helper.rb', line 9 def title(page_title, show_title = true) @content_for_title = page_title.to_s @show_title = show_title end |