So I'm trying to get a remove link next to the caption in an emails form. However, my rails voodoo is clearly very weak. It escapes the HTML and I can't figure out how to get it to not. Any hints?
= f.input :email, :label => "Email " + link_to_remove_fields("[x]", f)
[edit] oh and yes, this does the same thing:
= f.input :email, :label => "Email #{link_to_remove_fields("[x]", f)}"
and here's my helper method...
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