On 11 October 2011 07:35, chand syed <[email protected]> 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 [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