Hi. I have some apps that i have "admin" areas to the clients manager the app. This "admin" is a directory on my controllers path, like this: my_site --> app -->-->controllers -->-->-->admin And my controllers in "admin", i use the correct namespace(example for clients_controller): class Admin::ClientsController < AdminController Only doing it and dont use routes, it run OK if i access by the url: http://localhost:3000/admin/clients But local and on my server(passenger) it is ok, and function normal, but on JRUBY i get an error because it is thinking that "admin" is a controller and "clients" is a action of "admin". My controllers is not restfull, so what i have to do, to correct it? Or what the best method to make the "admin"? I have to put any route? -- Atenciosamente, Paulo Coutinho. Blog: www.prsolucoes.com/blog Site: www.prsolucoes.com Msn: paulo-QE/7f1ia5mR0ubjbjo6WXg@public.gmane.org -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
> But local and on my server(passenger) it is ok, and function normal, but on > JRUBY i get an error because it is thinking that "admin" is a controller and > "clients" is a action of "admin". > > My controllers is not restfull, so what i have to do, to correct it? Or what > the best method to make the "admin"? I have to put any route?I have an admin section in jruby application. Try to set the routes explicit with an admin namespace. map.with_options(:namespace => "admin") do |admin| admin.resources :clients # or in non restful-pattern admin.clients_index ''clients'', :controller => ''admin/clients'', :action => ''index'' end -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hi. Your solution dont solve. But i try it: map.with_options(:namespace => "admin") do |admin| admin.clients_index ''admin/clients'', :controller => ''clients'' #im on admin so dont need redirect to "admin/clients" only "clients" end And to the index(home) action, it is OK, but for the others actions, NO (insert/delete/edit). This solution is near, but have to put all action do controller "clients". Any ideia? -- Atenciosamente, Paulo Coutinho. Blog: www.prsolucoes.com/blog Site: www.prsolucoes.com Msn: paulo-QE/7f1ia5mR0ubjbjo6WXg@public.gmane.org 2009/12/6 Kristian Hellquist <kristian.hellquist-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>> > But local and on my server(passenger) it is ok, and function normal, but > on > > JRUBY i get an error because it is thinking that "admin" is a controller > and > > "clients" is a action of "admin". > > > > My controllers is not restfull, so what i have to do, to correct it? Or > what > > the best method to make the "admin"? I have to put any route? > > I have an admin section in jruby application. Try to set the routes > explicit with an admin namespace. > > map.with_options(:namespace => "admin") do |admin| > admin.resources :clients > # or in non restful-pattern > admin.clients_index ''clients'', :controller => ''admin/clients'', > :action => ''index'' > end > > -- > > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
2009/12/6 Paulo Coutinho <paulo-QE/7f1ia5mR0ubjbjo6WXg@public.gmane.org>:> Hi. > > Your solution dont solve. > > But i try it: > > map.with_options(:namespace => "admin") do |admin| > admin.clients_index ''admin/clients'', :controller => ''clients'' #im on > admin so dont need redirect to "admin/clients" only "clients" > end > > And to the index(home) action, it is OK, but for the others actions, NO > (insert/delete/edit). > > This solution is near, but have to put all action do controller "clients". > > Any ideia?Oh my mistake ... :) map.with_options(:namespace => "admin") do |admin| admin.clients_index ''clients'', :controller => ''clients'', :action => ''index'' admin.clients_edit ''clients/:id/edit'', :controller => ''clients'', :action => ''edit'' admin.clients_insert ''clients/insert'', :controller => ''clients'', :action => ''insert'', :conditions => { :method => :post } end Hint: Your actions looks to match the resource-pattern> > > -- > Atenciosamente, > Paulo Coutinho. > Blog: www.prsolucoes.com/blog > Site: www.prsolucoes.com > Msn: paulo-QE/7f1ia5mR0ubjbjo6WXg@public.gmane.org > > > 2009/12/6 Kristian Hellquist <kristian.hellquist-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> >> >> > But local and on my server(passenger) it is ok, and function normal, but >> > on >> > JRUBY i get an error because it is thinking that "admin" is a controller >> > and >> > "clients" is a action of "admin". >> > >> > My controllers is not restfull, so what i have to do, to correct it? Or >> > what >> > the best method to make the "admin"? I have to put any route? >> >> I have an admin section in jruby application. Try to set the routes >> explicit with an admin namespace. >> >> map.with_options(:namespace => "admin") do |admin| >> admin.resources :clients >> # or in non restful-pattern >> admin.clients_index ''clients'', :controller => ''admin/clients'', >> :action => ''index'' >> end >> >> -- >> >> 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To unsubscribe from this group, send email to >> rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> For more options, visit this group at >> http://groups.google.com/group/rubyonrails-talk?hl=en. >> >> > > > > > -- > > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hi. But my system is an ERP, i have more than 20 controllers. I have to make it for all controllers and actions? My actions is in portuguese, not "edit" but "alterar"... i put here an example of my structure. Dont have other method? A route that redirect all with "admin/" to "admin/:controller/:action/:id" ??? 2009/12/7 Kristian Hellquist <kristian.hellquist-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>> 2009/12/6 Paulo Coutinho <paulo-QE/7f1ia5mR0ubjbjo6WXg@public.gmane.org>: > > Hi. > > > > Your solution dont solve. > > > > But i try it: > > > > map.with_options(:namespace => "admin") do |admin| > > admin.clients_index ''admin/clients'', :controller => ''clients'' #im > on > > admin so dont need redirect to "admin/clients" only "clients" > > end > > > > And to the index(home) action, it is OK, but for the others actions, NO > > (insert/delete/edit). > > > > This solution is near, but have to put all action do controller > "clients". > > > > Any ideia? > > Oh my mistake ... :) > > map.with_options(:namespace => "admin") do |admin| > admin.clients_index ''clients'', :controller => ''clients'', :action => > ''index'' > admin.clients_edit ''clients/:id/edit'', :controller => ''clients'', > :action => ''edit'' > admin.clients_insert ''clients/insert'', :controller => ''clients'', > :action => ''insert'', :conditions => { :method => :post } > end > > Hint: Your actions looks to match the resource-pattern > > > > > > > > -- > > Atenciosamente, > > Paulo Coutinho. > > Blog: www.prsolucoes.com/blog > > Site: www.prsolucoes.com > > Msn: paulo-QE/7f1ia5mR0ubjbjo6WXg@public.gmane.org > > > > > > 2009/12/6 Kristian Hellquist <kristian.hellquist-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > >> > >> > But local and on my server(passenger) it is ok, and function normal, > but > >> > on > >> > JRUBY i get an error because it is thinking that "admin" is a > controller > >> > and > >> > "clients" is a action of "admin". > >> > > >> > My controllers is not restfull, so what i have to do, to correct it? > Or > >> > what > >> > the best method to make the "admin"? I have to put any route? > >> > >> I have an admin section in jruby application. Try to set the routes > >> explicit with an admin namespace. > >> > >> map.with_options(:namespace => "admin") do |admin| > >> admin.resources :clients > >> # or in non restful-pattern > >> admin.clients_index ''clients'', :controller => ''admin/clients'', > >> :action => ''index'' > >> end > >> > >> -- > >> > >> 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > >> To unsubscribe from this group, send email to > >> rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > >> For more options, visit this group at > >> http://groups.google.com/group/rubyonrails-talk?hl=en. > >> > >> > > > > > > > > > > -- > > > > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To unsubscribe from this group, send email to > > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > > For more options, visit this group at > > http://groups.google.com/group/rubyonrails-talk?hl=en. > > > > -- > > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > >-- Atenciosamente, Paulo Coutinho. Blog: www.prsolucoes.com/blog Site: www.prsolucoes.com Msn: paulo-QE/7f1ia5mR0ubjbjo6WXg@public.gmane.org -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
> But my system is an ERP, i have more than 20 controllers. > > I have to make it for all controllers and actions?I have an application with something like 20 controllers and make all routes explicit for each controller.> > My actions is in portuguese, not "edit" but "alterar"... i put here an > example of my structure. > > Dont have other method? A route that redirect all with "admin/" to > "admin/:controller/:action/:id" ??? >You could probably do map.with_options(:namespace => "admin") do |admin| admin.connect '':controller/:action/:id'' end -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hum. Ok. The last solution doesn''t work, so i think that i''ll have to make a route to each controller :( Do you make one route by controller? Can you post an example about how i can redirect all from "admin/clients" to correct controller/action/id ? 2009/12/7 Kristian Hellquist <kristian.hellquist-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>> > But my system is an ERP, i have more than 20 controllers. > > > > I have to make it for all controllers and actions? > > I have an application with something like 20 controllers and make all > routes explicit for each controller. > > > > > My actions is in portuguese, not "edit" but "alterar"... i put here an > > example of my structure. > > > > Dont have other method? A route that redirect all with "admin/" to > > "admin/:controller/:action/:id" ??? > > > > You could probably do > > map.with_options(:namespace => "admin") do |admin| > admin.connect '':controller/:action/:id'' > end > > -- > > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > >-- Atenciosamente, Paulo Coutinho. Blog: www.prsolucoes.com/blog Site: www.prsolucoes.com Msn: paulo-QE/7f1ia5mR0ubjbjo6WXg@public.gmane.org -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I make a solution that work fine to me, but i have to create one for each controller: # clients map.admin_clients ''/admin/clients/:action/:id'', :controller => ''/admin/clients'' ... 2009/12/7 Paulo Coutinho <paulo-QE/7f1ia5mR0ubjbjo6WXg@public.gmane.org>> Hum. Ok. > > The last solution doesn''t work, so i think that i''ll have to make a route > to each controller :( > > Do you make one route by controller? Can you post an example about how i > can redirect all from "admin/clients" to correct controller/action/id ? > > > > > 2009/12/7 Kristian Hellquist <kristian.hellquist-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > >> > But my system is an ERP, i have more than 20 controllers. >> >> > >> > I have to make it for all controllers and actions? >> >> I have an application with something like 20 controllers and make all >> routes explicit for each controller. >> >> > >> > My actions is in portuguese, not "edit" but "alterar"... i put here an >> > example of my structure. >> > >> > Dont have other method? A route that redirect all with "admin/" to >> > "admin/:controller/:action/:id" ??? >> > >> >> You could probably do >> >> map.with_options(:namespace => "admin") do |admin| >> admin.connect '':controller/:action/:id'' >> end >> >> -- >> >> 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To unsubscribe from this group, send email to >> rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> >> . >> For more options, visit this group at >> http://groups.google.com/group/rubyonrails-talk?hl=en. >> >> >> > > > -- > Atenciosamente, > Paulo Coutinho. > Blog: www.prsolucoes.com/blog > Site: www.prsolucoes.com > Msn: paulo-QE/7f1ia5mR0ubjbjo6WXg@public.gmane.org >-- Atenciosamente, Paulo Coutinho. Blog: www.prsolucoes.com/blog Site: www.prsolucoes.com Msn: paulo-QE/7f1ia5mR0ubjbjo6WXg@public.gmane.org -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
This works fine for me in jruby: map.namespace(:admin) do |admin| admin.resources :clients admin.resources :options, :has_many => :widgets end Does this not work? Make sure its above the default routes... -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hi. Im already try it, but no sucess. My controllers is not restfull. 2009/12/7 Freddy Andersen <freddy-RCI/mp9mI1I6GGFevw1D/A@public.gmane.org>> This works fine for me in jruby: > > map.namespace(:admin) do |admin| > admin.resources :clients > admin.resources :options, :has_many => :widgets > end > > Does this not work? > > Make sure its above the default routes... > > -- > > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > >-- Atenciosamente, Paulo Coutinho. Blog: www.prsolucoes.com/blog Site: www.prsolucoes.com Msn: paulo-QE/7f1ia5mR0ubjbjo6WXg@public.gmane.org -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.