Qasem Hajizadeh


50 Experience
0 Lessons Completed
0 Questions Solved


Posted in ruby on rails nested model relationship and routes

I have these models: Sport, Country, League and Match
Also I do have SportsController, CountriesController, LeaguesController and MatchsController

So the question is:
1: how i can set relation between models ?
2: how i can set routs like this



Note : all of the countries don't have all sports for example Soccer Sport exist in all countries but volleyball exist in some countries

logo Created with Sketch.

Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

© 2020 GoRails, LLC. All rights reserved.