Re: [Rails] save 2 value in diffrent field in one field at database
On Sat, Dec 15, 2012 at 9:53 PM, Mas Bejo <lists@ruby-forum.com> wrote:
> i want to get value from 2 diffrent field, first
> from text_field, and second from select_date, and i want to save it in
> one field "TTL" in database, this is the syntax,
> i change my model file to be like this:
See: http://api.rubyonrails.org/classes/ActiveRecord/Base.html (search
"serialize") ...If you want to be able to be able to select by that
field you'll need a custom serializer and PostgreSQL so you can use
Hstore (you can also use JSON datatype in PostgreSQL 9.2 but that
requires even more work because JSON is still a new feature so it
doesn't have the same select support that Hstore has.)
--
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home