mirror of
https://github.com/ENSL/ensl.org.git
synced 2024-12-27 04:51:14 +00:00
12 lines
432 B
Ruby
12 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
|