anhonigman1848/mhsbake — comment on commit 0ff048a5b627c44186f9ed8b6df5b96f46942d9d
File:  line 0
By sedan444:

I have seen the error of my ways!

It always seemed hackish to 'fake' a controller just to be able to show an expanded view. So when the remote site turned finicky I thought maybe there ought to be a better way. And there was! Instead of a fake NewspaperRecordsController, just write a method in the NewspaperReelsController (which is the controller that gets used anyway) to send the same data to a different view. But you don't CALL it a view -- call it something else, like 'expanded'. Then it gets accessed at mhsbake/newspaper_reels/expanded. Similarly, if you choose to view an expanded record, the 'view' button takes you to mhsbake/newspaper_reels/record/440 for the 440th record.

Anyhow, the idea that we can custom write methods in our controllers is kind of liberating. It took a while to figure out how to link all the urls together, but it all makes sense now that I see how it's done. Lots of examples here of how to construct links.