I had a question that was marked as a duplicate but it really didn't answer my question, but it did answer another question that I had so that was great :) I think perhaps I did not explain myself correctly so going to try again. Please keep in mind that I am still relatively new to RoR. My previous question can be found here:
Rails: Select on 1 field returns value to another field
So, let me explain what I am trying to achieve again. I have a table called plans and a table called plan_prices. A plan has many plan prices. I have another table called contracts. A contract can have a plan and a plan price, so the contract table has plan_id and plan_price_id. So here is what I am trying to achieve. When I create a contract I have a select for the plan which returns the plan_id. I also have a select on the plan_price that returns the plan_price_id. This first select has some JS on it to determine when it changes so that the plan_price is filtered accordingly. All this is working just fine. The final piece that I want to do is when I select the plan_price there is a column on that table called price. I want to take this price and default it into the contract.price field which can then be changed if the user deems necessary. I am just having a hard time working out how I would default the plan_price.price value into the contract.price field once the plan_price has been selected. The contract.price field is a simple free entry field and not a select field, since the user can change the price to something else.
Hope the above is clear and I hope that there is someone that can help me out on this.
TIA.