Although my Rails-fu is only of moderate strength...

The only thing determining the expected type of a particular params hash 
value (they are all strings as you said) is the intended receiver... 
which sounds like a model to me (@entry)... which would make the 
translation from UK to US the model's business... which would lead me to 
create a model method to employ between the params hash and the model 
assignment

@entry = Entry.new.localized 'US', params[:entry]

or something like that.

The localized method could check just the params attributes necessary 
(Entry knows which attributes it has to check, other models know their 
attributes), and the code that actually does the normalization per 
attribute might go in a helper, a module, or as part of a superclass 
between AR and Entry depending on how often it was used.

Fred probably has a better way though... ;)

-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
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