I have three tables, one of which is a join table between the other two tables.
- Jobs: id
- Counties: id
- Countyizations: job_ib, county_id
I want to create a list of counties a specific job has associations with. I'm trying to use something like:
<%= @counties.map { |county| county.id }.join(", ") %>
But this obviously is not using the countyizations table. How can I change the above code to accomplish what I need? Also, I'd like to list the counties alphabetically in ASC order.
Thanks!!
P.S.
I suppose I should have added how I'm linking my tables in my models.
- Jobs: has_many :countyizations & has_many :counties, :through => :countyizations
- Counties: has_many :countyizations & has_many :jobs, :through => :countyizations
- Counyizations: belongs_to :county & belongs_to :job