Module: SurveysHelper

Defined in:
app/helpers/surveys_helper.rb

Instance Method Summary collapse

Instance Method Details

#javascript(*args) ⇒ Object



25
26
27
# File 'app/helpers/surveys_helper.rb', line 25

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


5
6
7
8
9
10
11
# File 'app/helpers/surveys_helper.rb', line 5

def link_to_add_fields(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


2
3
# File 'app/helpers/surveys_helper.rb', line 2

def link_to_remove_fields(name, f)
end

#show_title?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'app/helpers/surveys_helper.rb', line 17

def show_title?
  @show_title
end

#stylesheet(*args) ⇒ Object



21
22
23
# File 'app/helpers/surveys_helper.rb', line 21

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

#title(page_title, show_title = true) ⇒ Object



12
13
14
15
# File 'app/helpers/surveys_helper.rb', line 12

def title(page_title, show_title = true)
  @content_for_title = page_title.to_s
  @show_title = show_title
end