Forum: Ruby on Rails directory structure on typo

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
66d1d0df01e4bbb82674a353ea68d6ee?d=identicon&s=25 Josh Kieschnick (jjkiesch)
on 2006-06-04 15:21
i was looking through the typo code and see that all of the
administrative controllers and views are placed in another subfolder. i
tried just moving the files just for kicks and it didn't work (didin't
really expect it to, but it was worth a shot.)

so how do you set something up like that? i tried looking in the
routes.rb file, but i'im not sure what's in there that i would need and
what i wouldn't, plus i'm really trying to learn this and how things
work instead of just copying and pasting other people's code.
455ac2a64d06dc8461f4d258d7f7e980?d=identicon&s=25 Michael Trier (Guest)
on 2006-06-04 15:29
(Received via mailing list)
When creating the controllers, etc... if you add the path information
it will be done for you.  So for example, if you type:

script\generate controller Admin/Account show

You will end up with a directory structure that has
/app/controllers/admin/account_controller.rb and
/app/views/admin/show.rhtml

Michael
30ee518e6fdc5b07e060775b5a542bdb?d=identicon&s=25 Jón Borgþórsson (jongretar)
on 2006-06-04 15:32
(Received via mailing list)
Also remember that if you create controllers like 'admin/user',
'admin/messages' you will not be able to create a controller called
just 'admin' as that will confuse rails. Instead you create a
controller like 'admin/base' and make a route to map site.com/admin to
site.com/admin/base

On 6/4/06, Michael Trier <mtrier@gmail.com> wrote:
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>


--
66d1d0df01e4bbb82674a353ea68d6ee?d=identicon&s=25 Josh Kieschnick (jjkiesch)
on 2006-06-04 15:46
Michael Trier wrote:
> When creating the controllers, etc... if you add the path information
> it will be done for you.  So for example, if you type:
>
> script\generate controller Admin/Account show
>
> You will end up with a directory structure that has
> /app/controllers/admin/account_controller.rb and
> /app/views/admin/show.rhtml
>
> Michael

i didn't think about doing that when the controller was created. that's
prlly why mine wasn't working. thanks.
66d1d0df01e4bbb82674a353ea68d6ee?d=identicon&s=25 Josh Kieschnick (jjkiesch)
on 2006-06-04 15:47
Jón Borgþórsson wrote:
> Also remember that if you create controllers like 'admin/user',
> 'admin/messages' you will not be able to create a controller called
> just 'admin' as that will confuse rails. Instead you create a
> controller like 'admin/base' and make a route to map site.com/admin to
> site.com/admin/base
>
> On 6/4/06, Michael Trier <mtrier@gmail.com> wrote:
>> _______________________________________________
>> Rails mailing list
>> Rails@lists.rubyonrails.org
>> http://lists.rubyonrails.org/mailman/listinfo/rails
>>
>
>
> --

that probably would have been my next question. thanks for the help!
This topic is locked and can not be replied to.