Sorry for not putting up the solution earlier, here is what I have
come to.
At first I had a module that I was trying to fake multiple inheritance
through.
module UserHelper
#the views for these actions are in /apps/view/user
def favorites
render :template => "/user/favorites" #<--added these after
first post
end
def friends
render :template => "/user/friends" #<--added these after
first post
end
end
class UserController < ApplicationController
include UserHelper
end
#a developer is a user with added functionality
class DeveloperController < ApplicationController
include UserHelper
def profile
#template is in views/developer
end
def upload
#template is in views/developer
end
end
With this setup i can do this: localhost:300/developer/friends and get
a view to render that was in the user's view. I experimented with this
for a while then I talked to a more experienced rails programmer. He
said to take the actions out of the userhelper module and put them
where they belong (the user controller); then do what I was trying to
do through routes. If I needed to determine if a user was a developer
before I perform an action to use a before_filter in the user
controller. So this is the code that I put into my routes.
map.connect "developer/:action",
:requirements => {:action => /profile|upload/ },
:controller => "developer"
map.connect "developer/:action",
:controller => "user"
I felt that this was more concise and allowed for the proper code to
be in its respected controller. The problem I see with this is
everytime that I add an action to the developers section I have to g
oback to my routes file and add it to the regular expression.
So I was wondering if there was a way I could make these routes
dynamic enough to look into the developer controller if it cant find
the action in the user controller?
Once again Thank.
-Barry
> >> > - Caikehttp://caikesouza.com-Hidequoted text -
>
> >> > - Show quoted text -- Hide quoted text -
>
> >> - Show quoted text -
>
> > --
>
> > You received this message because you are subscribed to the Google Groups "Orlando Ruby Users Group Discussion" group.
> > To post to this group, send email to
orug-di...@googlegroups.com.
> > To unsubscribe from this group, send email to
orug-discussi...@googlegroups.com.
> > For more options, visit this group athttp://
groups.google.com/group/orug-discussion?hl=en.- Hide quoted text -