Admin::Controller

Thanks to the kind members of this forum, I’ve been able to place my
scaffolds under an “admin” subdirectory

1.http://sitename -

http://sitename/admin/scaffold_name

Yet, I’m wondering if its possible to do the following:

http://sitename/admin/

1st post not completed

Thanks to the kind members of this forum, I’ve been able to place my
scaffolds under an “admin” subdirectory (2.)

  1. http://sitename

  2. http://sitename/admin/scaffold_name

Yet, I’m wondering if its possible to do the following (3.) and have it
take me to an admin “homepage”… just an .rhtml page where a user can
select between the different scaffolds.

  1. http://sitename/admin/

When I try now, I get a routing error because no admin_controller.rb is
specified in the root controller directory. And, if I add it, I can no
longer use the (2.) method, because it doesn’t route the scaffolds
properly.

Any ideas?

Thank You,

This may be totaly wrong but I have seen code where you have something
like

Admin::Controller < ApplicationController

index
end

main
end
end

In this case the controller acts as a controller for the Admin module so
the index page will be automatically loaded when you use:

http://sitename/admin

and the main page will be shown using this URL

http://sitename/admin/main

RJ wrote:

This may be totaly wrong but I have seen code where you have something
like

Admin::Controller < ApplicationController

index
end

main
end
end

In this case the controller acts as a controller for the Admin module so
the index page will be automatically loaded when you use:

http://sitename/admin

and the main page will be shown using this URL

http://sitename/admin/main

And I am an idiot as I didn’t read your post correctly and you pointed
out that this broke (2)…

On 3 October 2006 04:00, Ryan wrote:

Any ideas?
Make Admin::MainController and user routes to connect ‘/admin/’ to this
controller:

map.connect ‘/admin/:controller/:action/:id’
map.connect ‘/admin’, :controller => ‘/admin/main’

Caution, this will work only for one action (in the example - ‘index’).
But I
guess this will be sufficient for your case.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs