Select or select_tag

Which is the easiest to implement in a Rails app view when pulling data
from tables? select or select_tag?

Thank you,

Rachel S Nichol
Oracle Developer
Hargray Telephone Company

Positive Exchange of Control

Hargray’s mission: To envision and deliver customer delight

I believe they’re fairly equivalent WRT populating them w/values.

I think the main distinction is whether you’re feeding the selected
value into a form that builds a model object or not. If you’re in a
form_for block, then select is easier (e.g., it uses the context of the
form builder to save you from having to worry about how the value gets
serialized in the params hash). If you’re in any other kind of form,
then select_tag may be necessary.


From: [email protected]
[mailto:[email protected]] On Behalf Of Rachel N.
Sent: Tuesday, July 14, 2009 8:08 AM
To: [email protected]
Subject: [Rails] select or select_tag

Which is the easiest to implement in a Rails app view when pulling data
from tables? select or select_tag?

Thank you,
Rachel S Nichol
Oracle Developer
Hargray Telephone Company

Positive Exchange of Control

Hargray’s mission: To envision and deliver customer delight


GHC Confidentiality Statement

This message and any attached files might contain confidential
information protected by federal and state law. The information is
intended only for the use of the individual(s) or entities originally
named as addressees. The improper disclosure of such information may be
subject to civil or criminal penalties. If this message reached you in
error, please contact the sender and destroy this message. Disclosing,
copying, forwarding, or distributing the information by unauthorized
individuals or entities is strictly prohibited by law.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs