I’ve decided to add React to a Rails app I built. Right now I am trying to create a select box in a form. The form creates new Transactions. Each Transaction belongs_to one Program and one Account.
Currently I have the Transactions showing up, along with a form and delete actions. But I am having some trouble.
The next layer of trouble is how to create a select box in React. React has no
options_for_select helpers. I have figured out how to create a select box, but I need it to be populated by the database table Programs.
The third layer of difficulty is how to deal with associations. I can’t type
To help wrap my head around the problem, I decided to follow Justin Weiss’s fabulous advice, and build a mini-app. This simplified the problem for me, by taking it down to the simplest level that I was having trouble with – how to access associations in a rails app, using React. Thanks to this excellent tutorial, and with a bit of muddling around, I’ve figured out how to access associations. Now I have to figure out how to put this into a select box with coffeescript.