[Brug-talk] Controllers owning controllers
Thomas Richard
thomas9999 at gmail.com
Sat Nov 10 08:32:37 EST 2007
Hey Belgian Rubyists,
I've just completed the book 'Agile web development in Rails' and I've
been playing around a bit before i start to work in my first real
rails application. Now while playing I came to a problem wich i might
be able to solve but if I'd do it my way it would break all the Rails
conventions the book was been telling about. So there should be a more
'agile' solution to this problem.
Let me try explain the problem:
The application would be build on a few big modules e.g: projects,
services, delivery's, stock, ...
Under these big modules I'd have a few smaller modules e.g: employees,
products, price requests, ...
The big problem now is that i would need to share the functionalirty
of these smaller modules between the bigger modules. The functions of
all the smaller modules should be exactly the same everywhere. It
probably has a simple solution but i can't seem to find one. The way
I'd try to solve the problem is making a controller for the projects,
services, .. modules , but i don't know how I'd have to handle the
smaller ones. I could put them in different rb files and require them
into the controllers but that just doesn't seem right.
When i was thinking about the URI's i came to a possible second
solution. The URI's would have to look something like
app/projects/pricerequests/new
Now that gave me a new perspective on the case. I could actually put
the smaller modules into controllers and just use the greater modules
as dummies. They're just there to organize the smaller modules into
groups. Then again, i wouldn't know how i could get something like
this working in rails as this would screw up the way the view system
works?
As you can probably see i found it hard to explain the problem but i
hope any of you can make something out of this. Would be nice of
someone wants to discuss about this with me (in private or not). I
hope questions like these are allowed in this mailing list ;)
Greetings
Thomas
More information about the Brug-talk
mailing list