Hello, thanks for reading.
I used scaffolding to set my pages up, and I’ve been editing them to get
the effect that I want, but I’m running into a few problems.
The first problem:
I have 2 drop down menus, with pre-determined choices, let’s say, “Ruby,
Python, Java” are in the first drop down, and “Is awesome!, Sucks, etc.”
are in the second. I then want to concatenate them with a space in
between, and have that as the input into my database. Currently I have:
<%= f.select(:part1, List::NAME) %>
<%= f.select(:part2, List::TYPE) %>
Where NAME is the first list, and TYPE is the second, they’re defined in
the list model. The drop down lists work, but I have no idea how to go
about concatenating “part1” and “part2”, and nothing that I’ve tried
works.
Second problem:
I want another drop down list, except that I want the choices to be from
another table in the database. In other words, I have a table called
users, which just has two fields: id and name. I want every user name to
come up in this list. The name itself is also what I want to be saved to
the database for that entry.
I’ve been programming for a while, and just started picking up Ruby a
few months ago, and I completely love it. This is my first time working
with web apps, and it’s been pretty challenging so far, and I’m hoping
that I can get the hang of it soon. Thanks anyone for the input!