Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
04-10-2007, 09:09 PM #1
- Join Date
- Feb 2005
- Bradford, UK
- Thanked 66 Times in 65 Posts
Rails controllers - 1 for every model?
I've been going through some RoR tuts and reading Agile Web Developer with Ruby on Rails (I think thats what the book is called) and I've created an admin controller BUT I want the admin controller to manage multiple models as my application isnt run on a single model. In the Depot application with the book I'm reading their admin controller only manages a single table/model. In other examples I've seen, they create a controller for every model.
Is it possible to have multiple scaffolds in a single controller? Or am I totally missing the point.
05-22-2007, 01:30 AM #2
- Join Date
- Jan 2007
- Thanked 1 Time in 1 Post
I am also fairly new to rails... But it doesn't matter...
If you were using 2 different models, i forgot your exact post but here's an example of using 2.
@user = User.find(@params["id"])
@images = Images.find_all(@params["id"])
As far as scaffolding 2 models... Any particular reason you want to? Scaffolding is sort of a temporary guide.
No trees were harmed in the transmission of this message.
However, a rather large number of electrons were temporarily