Hi,
For what I understand I''m not sure you can do it by using routes.
Perhaps you can if each type of account have a special controller,
then in your routes you would have to redirect the /
special_account_controller/action/someid to the correct view. If there
is no special controller I''m not sure you can do it with the routes
since I don''t see how you would know the current type of account
If there is no special controller for each account then you can check
the type of account in the controller and make a redirect if
necessary.
Perhaps you can directly link in your view themselves to the righ next
view (using some helper then else it will be messy quite quickly).
I think if I were you I would use the second option and make one big
helper taking the view trying to achieve, the type of account and then
retourning the correct view. That seems the most DRY way.
My 2 cents.
Chewbie
On May 14, 4:14 pm, "Keith Davey"
<keith.da...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Hi,
>
> I am looking for an approach to do the following.
>
> I have an app which will serve multiple accounts. In many cases they
> will use the same views.
>
> The public part of each account is served by a public controller, so I
> have an app/views/public/index.rhtml for instance.
>
> In certain cases there will be a custom version of these pages for
> accounts. I would like to be able set up something like
> app/custom/someid/index.rhtml
>
> Is there an easy way to redirect the request so the correct view is
> used. I was thinking of routes but its looking for more like a coding
> job.
>
> Thanks,
>
> Keith
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---