What I am trying to do is to nest my pages in Rails for example:
www.mysite.com/fifa17/ps4
This way, once I am on the show.html.erb, I can use use the route to sell my product for specifically that game on that console platform..
At the moment, I have a Console
model with has_many :games
and a Game
model with has_many :consoles
, but I can't get the routing and views to work. Do I have just one controller or two?
I have both the Games
and Consoles
seeded under ActiveRecords by name
.
I seem to be able to call one of the actions (i.e. Console.name
) but cannot call both the console name and Game name.
A great place to read on this would be in Ruby on Rails Associations Guide and Routing Guide.
What you want to do, is to update your
Console
andGame
associations, to usehas_and_belongs_to_many
. You can read more on that hereAnd double check your routing, check this StackOverflow Question for a similar case.