Forum: Rails Engines Using User_Engine

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.
Benjamin (Guest)
on 2006-05-26 04:47
I will be working on an information system in a few weeks. I have
finally gotten the User_Engine engine to work but have realized that to
access any part of the engine it's always accessed at
http://local../user/user_engine action.

I have two questions:

-Is there any ways I can rename /user/ to something such as /portal/,
etc.

-If I want to create a controller within /user/, how can I do that. Ex.
http://local../user/dashboard/

Thanks,

Benjamin J. Hecht
Benjamin (Guest)
on 2006-05-26 06:31
I forgot to add: Can model data for models in the user_engine folder be
accessed from controllers outside of the user_engine folder.
James A. (Guest)
on 2006-05-26 13:11
(Received via mailing list)
On 5/26/06, Benjamin <removed_email_address@domain.invalid> wrote:
> I will be working on an information system in a few weeks. I have
> finally gotten the User_Engine engine to work but have realized that to
> access any part of the engine it's always accessed at
> http://local../user/user_engine action.
>
> I have two questions:
>
> -Is there any ways I can rename /user/ to something such as /portal/,
> etc.

Yes - use routes.

> -If I want to create a controller within /user/, how can I do that. Ex.
> http://local../user/dashboard/

Probably the simplest way is to create a normal 'dashboard' controller
and use routes to make it look like it's under /user/dashboard.
Anything else is probably going to get a bit complicated, especially
if you're not intimately familiar with Rails.

On 5/26/06, Benjamin <removed_email_address@domain.invalid> wrote:
> I forgot to add: Can model data for models in the user_engine folder be
> accessed from controllers outside of the user_engine folder.

... yes. All of the code within an engine is available pretty much as
if it was sitting in your /app folder.

- james
Riko (Guest)
on 2006-05-30 17:26
> -If I want to create a controller within /user/, how can I do that. Ex.
> http://local../user/dashboard/

You can define a User::DashboardController. But then you have to work
with routes in any case, since it would search a dashboard method in the
UserController before the index method in the User::DashboardController.
This topic is locked and can not be replied to.