Go Back   CodingForums.com > :: Server side development > Ruby & Ruby On Rails

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 04-10-2007, 08:09 PM   PM User | #1
NancyJ
Senior Coder

 
NancyJ's Avatar
 
Join Date: Feb 2005
Location: Bradford, UK
Posts: 3,162
Thanks: 19
Thanked 65 Times in 64 Posts
NancyJ will become famous soon enough
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.
__________________
http://www.hazelryan.co.uk
NancyJ is offline   Reply With Quote
Old 05-22-2007, 12:30 AM   PM User | #2
jayemvee
New Coder

 
Join Date: Jan 2007
Posts: 64
Thanks: 0
Thanked 1 Time in 1 Post
jayemvee is an unknown quantity at this point
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.

def method_name
@user = User.find(@params["id"])
@images = Images.find_all(@params["id"])
end

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
inconvenienced.
jayemvee is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:20 AM.


Advertisement
Log in to turn off these ads.