I have two databases Tours and Bands such that:
-
- begin code - -
class Band < ActiveRecord::Base
belongs_to :tours
endclass Tour < ActiveRecord::Base
has_one :bands
end -
- end code - -
In my admin_tours I have added a bit of code that gives me a drop down
menu with a selection of all bands in Bands:
-
- begin code - -
Band
<%= select("band", "band_id", Band.find_all.collect {|p| [ p.name,
p.id ] }) %>
-
- end code - -
Of course you imagine that I am looking to have band_id save when i save
tours. I am having a difficult time figuring out what code works I
should put in my ‘admin_tours_controller’. As I have scaffolded this out
so I am assuming I should be adding some sort of save code to ‘update’
and ‘create’.
I am willing to pay someone to walk me thru this (aim? tele?) or if you
have any quick (free) advice that would work too.
: )
thanks!