Re: model-controller-paradigm: What about admin controllers?

Jake Varghese
Sat, 16 Dec 2006 17:13:31 -0000

>> app/
>> --admin/
>> ----posts_controller.rb        <= for administration
>> ----comments_controller.rb
>> --post_controller.rb           <= public facing
>> --comments controller
>
> So they are called like this?
>
> PostsAdminController
> CommentsAdminController
> PostsController
> AdminController
>
> Right? Is there no problem for Rails to find the admin controllers? Do I
> have to adjust the path var or something?

actually, they are called
Admin::PostsController
Admin::CommentsController
PostsController
CommentsController

so, when you do a link_to to the admin section you would use:
link_to "Link Me", :controller => "admin/posts", :action
=> "edit_post",
:id => 1

Most of the time, you will never do the above because you usually dont
want to link from the public facing side to the admin side.