Forum: Ruby on Rails better to derive and set a property in the model or controll

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
mtmusko (Guest)
on 2005-11-12 13:49
(Received via mailing list)
Hi,

I have a user model with city, state, and ZIP code properties.  I have
a separate ZIP code model which has info about zipcodes including the
city and state for the ZIP code.

Right now when the user controller receives a create request with the
ZIP code entered I then set the city and state properties by looking
up the city and state in the ZIP code model.  Is this the right way to
do it or is it better to be doing in the user model?  If it is done in
the user model how would you suggest it be then?

Thanks,
--
Frank K.
http://meetingkoreans.com
http://betweengo.com
This topic is locked and can not be replied to.