Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

can't iterate from Float #19

Closed
jerodsanto opened this Issue · 6 comments

2 participants

@jerodsanto

I have a model with a float attribute and when I turn csv on for its form I get the following type error:

can't iterate from Float

Removing this field from the form makes everything work as expected.

I'm on Rails 3.0.5 using ActiveRecord, form_for and csv gem 3.0.0.beta.7.

@bcardarella
Owner

Can you provide some example code? Which validations are on the attribute?

@bcardarella
Owner

Also, is this a Rails error or a javascript error?

If it is Javascript take note that there is now a new javscript file starting with 3.0.0.beta.7: rails.validations.js

@jerodsanto

It's a Rails error. The field is called duration and the validation on it is:

validates_inclusion_of :duration, :in => 0.25..10, :message => "must be between 0.25 and 10.0 hours"

I recently upgraded this app to Rails 3 and haven't had a chance to switch to the new validates API. If you think that will help here I will give it a try.

The form is pretty vanilla. Here is the related label and field:

<%= form.label :duration, "Duration (hours)" %>
<%= form.text_field :duration, :autofocus => true %>
@bcardarella
Owner

Ok, I see it. I should have this fixed soon and push a new beta out later tonight. Thanks for the bug report.

@bcardarella
Owner

Fixed in 209a250

@jerodsanto

Confirmed, it works! Thanks for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.