Topic: Nested Forms, AJAX and Rails 3
I'm moving an app from Rails 2.3 to Rails 3.
I have a campaign that has many filters.
The filters have many different types, so they are STI.
I have a form for creating / updating the campaign that has the the filters as nested attributes, which works fine in 2.3. You pick which type of filter to add, click a button and it puts the new attributes in the form.
The code, in a .js.erb file, looks like this:
@object is the campaign and @filter is a new (unsaved) filter of the appropriate type.
This also works in Rails 3, but I get deprecation warnings for line 3, since the f.fields_for should now be using <%=.
What's the proper way to refactor this?