noticed the fix is in - thanks, Bryan!

along these lines, my users are complaining that if they paste in
values from excel, formatted with thousands separators, they're losing
everything after the comma.  I.e., 1,000.0 gets turned into 1.0.

Easy enough, I thought, so added the following code to my model:

  def convert_number_column_value(value)
    value.delete!(',') if value.is_a?(String)
    super
  end

Now, this works - to a point.  I can see that when super is called,
value has been stripped of commas.  However, hobo must be bypassing
the standard rails update mechanism, since despite value="1000.0" at
this point, the field is still being set to 1.0.

Is there some ajax magic happening here?

I know I could probably do this in before_validation, but that's not
DRY.

Mostly, I'm grumpy because this really belongs in the view, not the
model.

Likely I should redefine def tag="input" for="BigDecimal" to strip
commas, but I haven't yet figured out what text_field_tag is doing...

On May 27, 3:23 pm, Bryan Larsen <[email protected]> wrote:
> Yup, that accidentally got killed with the big_integer removal.
> (Actually, it was the big_integer input that ended up almost
> accidentally handling the BigDecimal case as well).  I'll throw that
> back in today.
>
> cheers,
> Bryan
>
> On May 27, 2:35 pm, Montgomery Kosma <[email protected]> wrote:
>
> > either I'm missing something or I found an obvious omission in
> > rapid_forms.dryml --
>
> > <def tag="input" for="BigDecimal" attrs="name">
> >   <%= text_field_tag(name, this, attributes) %>
> > </def>
>
> > should there also be a def tag="editor" in rapid_editing.dryml?
>
> > monty
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/hobousers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to