i am new to rails.this is what i have done and trying to do, i have refills model and refills controller, user model and user controller, user model has phone number which i want to show in refills/new, just display.
What i want to learn and am confused with is, how to show various models info and stuff in views of other controllers? How do they relate each other? how to make them relate each other? Where do i put the methods for the parmas and how they are passed? for example, i have wallet model and wallet controller, when user refills through refill controller i want the amount deducted from wallet? how can i achieve that?
i want to port a site that i use at work to rails, and learn in process. i am pretty familiar with ruby, and in railssome things just confuse me. rite now i am stuck at how to make models comunicate with each other. like i have refill model, wallet model, and user model, refill belongs to wallet, wallet belongs to user and has many refills, user has one wallet and has many refills through wallet. i have all tables set, but how do i make them work together, like when user refills, :balance from wallet will be deducted, and the refills witll go to user's :phone_number. what is the term called?
how do i search it online? can you point me to links which talks about exactly that?