You''re probably better off just namespacing ''admin''
in your routes.
namespace :admin do
resources :posts
end
Then you''ll get "admin/posts" for admin_posts_path
For your controller, you''ll just need to prefix the namespace
class Admin::PostsController < ApplicationController
Just remember that you''ll need to keep your controllers and views in a
separate ''admin'' folder.
Hope this helps.
On Aug 29, 2:08 am, coolesting
<coolest...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Hi, everyone,
>
> I set a url as resource :posts, :path => "/admin/posts",
> So, how can i get this partial path like this ''admin'' ?
> I just want to get this word ''admin'' in controller.
>
> thank you.
--
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.