Hi, All. I try to relocate controllers. Admin space controlers moved to /app/controllers/admin and user space controllers to /app/controllers/user In routes.rb I use map.connect ''search'', :controller => ''user/search'' that correct I see. But when I want to use start_form_tag or simply url_for, that used in start_form_tag, I do not know how generate url like /search, becouse url_tag return url corresponding with routes.rb rules: /user/search So, what is the right way to do this? -- timurv mailto:timurv-NKHNqjRO7gY@public.gmane.org
Hi, I myself use map.search :controller => ''search'', that works for me.. timurv-NKHNqjRO7gY@public.gmane.org wrote:> Hi, All. > > I try to relocate controllers. Admin space controlers moved to > /app/controllers/admin and user space controllers to > /app/controllers/user > > In routes.rb I use > > map.connect ''search'', :controller => ''user/search'' > > that correct I see. > > But when I want to use start_form_tag or simply url_for, that used in > start_form_tag, I do not know how generate url like /search, becouse > url_tag return url corresponding with routes.rb rules: > > /user/search > > So, what is the right way to do this? > >
Hi, On 12/23/05, timurv-NKHNqjRO7gY@public.gmane.org <timurv-NKHNqjRO7gY@public.gmane.org> wrote:> I try to relocate controllers. Admin space controlers moved to > /app/controllers/admin and user space controllers to > /app/controllers/user > > In routes.rb I use > > map.connect ''search'', :controller => ''user/search'' > > that correct I see. > > But when I want to use start_form_tag or simply url_for, that used in > start_form_tag, I do not know how generate url like /search, becouse > url_tag return url corresponding with routes.rb rules: > > /user/search > > So, what is the right way to do this?If I understand the question correctly I think you need to add a ''/'' at the start of the controller name. Something like the following; link_to(''Search'', :controller => ''/search'') link_to(''User Profile'', :controller => ''/user/profile'') link_to(''Admin Audit Log'', :controller => ''/admin/auditlog'') -- Cheers, Peter Donald Blog: http://www.RealityForge.org