mirror of
https://github.com/ENSL/ensl.org.git
synced 2024-12-26 12:30:48 +00:00
11 lines
432 B
Ruby
11 lines
432 B
Ruby
module PollsHelper
|
|
def add_option_link(name, form)
|
|
link_to_function name do |page|
|
|
option = render :partial => 'option', :locals => { :pf => form, :options => Option.new }
|
|
page << %{
|
|
this.counter = typeof this.counter == 'undefined' ? 0 : this.counter + 1;
|
|
$('options').insert({ bottom: "#{ escape_javascript option }".replace(/\\[\\d+\\]/g, "[" + this.counter + "]") });
|
|
}
|
|
end
|
|
end
|
|
end
|