This project is archived and is in readonly mode.
#fields_for always expects a model
Reported by Paul Sadauskas (Rando) | January 5th, 2010 @ 07:28 PM
I have a case where I have a hash object as a property of a alternative-ORM model, which I want to make form fields for. Using the fields_for helper almost works, except in one case, where it attempts to call #new_record? on the hash. Attached is a patch to check for the method first, and it works great.
As an example, the model I'm trying to construct fields for is generated like this:
def build_metric_filter
@metric_filter = MetricFilter.new
@metric_filter.criteria = [{:target => "Hostname", :comparison => "is", :pattern => ""}]
@metric_filter
end
Comments and changes to this ticket
-
Paul Sadauskas (Rando) January 5th, 2010 @ 07:30 PM
- no changes were found...
-
Rohit Arondekar October 8th, 2010 @ 12:05 PM
- State changed from new to stale
- Importance changed from to Low
Marking ticket as stale. If this is still an issue please leave a comment with suggested changes, creating a patch with tests, rebasing an existing patch or just confirming the issue on a latest release or master/branches.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>