Hai friends.......

My question is I have one table in that three columns a, b and c..

a=7 and b=10 given input now c value must be store as a+b means 7+10=17.

Please can anybody tell me solution...

Tahnk you.........

--
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Search Discussions

  • Colin Law at Oct 11, 2011 at 9:57 am

    On 11 October 2011 07:35, chand syed wrote:
    Hai friends.......

    My question is I have one table in that three columns a, b and  c..

    a=7 and b=10 given input now c value must be store as a+b means 7+10=17.
    Don't do it, there is no need as you can work it out whenever you need
    it. So do not have a column c in the database, just provide method c
    in the model:
    def c
    a+b
    end

    Then you can use your_object.c just as if it were a column in the db.

    Colin

    --
    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 this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedOct 11, '11 at 7:45a
activeOct 11, '11 at 9:57a
posts2
users2
websiterubyonrails.org
irc#RubyOnRails

2 users in discussion

Chand syed: 1 post Colin Law: 1 post

People

Translate

site design / logo © 2021 Grokbase