Module: JavascriptsHelper

Defined in:
lib/helpers/javascripts_helper.rb

Instance Method Summary collapse

Instance Method Details

#field_id_for_js(f, attribute) ⇒ Object



11
12
13
# File 'lib/helpers/javascripts_helper.rb', line 11

def field_id_for_js(f, attribute)
  "#{f.object_name}[#{attribute.to_s.sub(/\?$/,"")}]".gsub(/\]\[|[^-a-zA-Z0-9:.]/, "_").sub(/_$/, "")
end

#field_name_for_js(f, attribute) ⇒ Object



15
16
17
# File 'lib/helpers/javascripts_helper.rb', line 15

def field_name_for_js(f, attribute)
  "#{f.object_name}[#{attribute.to_s.sub(/\?$/,"")}]"
end

#javascript(*args) ⇒ Object



7
8
9
# File 'lib/helpers/javascripts_helper.rb', line 7

def javascript(*args)
  content_for(:head) { javascript_include_tag(*args) }
end

#stylesheet(*args) ⇒ Object



3
4
5
# File 'lib/helpers/javascripts_helper.rb', line 3

def stylesheet(*args)
  content_for(:head) { stylesheet_link_tag(*args) }
end