On Sep 2, 7:24 am, Colin Law <[email protected]> wrote:

> If you are just trying to set a hidden field could you not just pass
> whatever the user is entering/selecting to the server and compute the
> value there rather than doing it in the browser?  I believe it best to
> avoid js where possible.
>
> Colin
>

It's a conversion issue and I'm still in a proof of concept phase. The
old data structure stored the birthMMDD as a string(4) and I imported
a couple hundred thousand records.  If I move on with this
application, I'd break it down to two integer fields and I would not
need javascript or a computational method.

I'm trying to cut down my javascript habits, but sometimes it's just
faster. My next problem is phone numbers. They were stored as string
(10), but the user could use any format they wished. At the end, we
just stripped out the non digits and validated on 10 digits. But when
you are displaying it in the form, 10 straight digits without
formatting is not very user friendly. Stripping them out in a before
filter has also become non trivial because of a polymorphic
relationship where the phone number fields don't all use the same
field name. Its is almost faster to use javascript format the phone
number in a display field and put the unformatted number in the real
field.

Been "playing" with rails for about 3 years, but the world is more
than generated CRUD and there is a steep learning curve. You tend to
fall back to what you know.

Steve

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" 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/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to