Tom Goddard

Joined

1,270 Experience
12 Lessons Completed
0 Questions Solved

Activity

Posted in Nesting resources & controllers best practice

Hey Chris,

Thanks for your reply! makes a lot of sense.

In terms of folder structure, are there any pros / cons of putting nested resources controllers in their respective nested folders?

For example having your websites_controller in the controllers folder (controllers/websites_controller), then putting the pages_controller inside a folder such as controllers/websites/pages_controller.

Apologies for the long winded question, hope this makes sense.

Posted in Nesting resources & controllers best practice

Hi all,

I'm relatively new to rails so apologies if this is a very basic concept / been asked before, I've had a look around and can't really find any best practices for when to use nested controllers.

For example, If you had a "Websites" controller and a "Pages" controller, the pages wouldn't exist without the Website, so would these be nested together?

This would match the routes and seems to make sense from a logic standpoint.

Thanks!

Posted in How to use Hotwire in Rails Discussion

great thanks

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

© 2021 GoRails, LLC. All rights reserved.