Ok. I get it. It would really be a mess when you have multiple engines, I'll 
namespace everything in the engine. Thanks.

Still, this won't solve my cancan problem.


On May 24, 2012, at 3:03 PM, Scott Johnson wrote:

> If you just merged the ApplicationControllers, then the code in the last 
> loaded engine would take precedence in the main app and all other engines.  
> And if you overwrote some methods in one engine and others in another you 
> would quickly have a quagmire.
> 
> Using inheritance provides a nice predictable way to change behavior.  This 
> way you main application stays unaltered and each engine can access this code 
> and change its behavior without affecting the main app or other engines.
> 
> Sent from my iPhone
> 
> On May 24, 2012, at 8:31 AM, Luís Ferreira <[email protected]> wrote:
> 
>> Ok. This will solve the problem, but still I don't understand why both 
>> application controllers could not be merged.
>> On May 23, 2012, at 11:49 PM, Ryan Bigg wrote:
>> 
>>> Indeed, the application's app/controllers/application_controller.rb will 
>>> take precedence over a similarly named file in the engine. The same goes 
>>> for anything else in the app directory, too.
>>> 
>>> This is why you namespace your engine: to avoid collisions such as these. 
>>> On Thursday, 24 May 2012 at 4:46 AM, Luís Ferreira wrote:
>>> 
>>>> Hi,
>>>> 
>>>> I've been using rails 3 engines and (at least in my experience) the 
>>>> engine's application controller is overidden by the app's application 
>>>> controller. Wouldn't it be better if the app would just load on top of the 
>>>> engine?
>>>> 
>>>> I mean that if an engine's application controller has methods or anything 
>>>> else that does not collide with the stuff defined with the app, couldn't 
>>>> it be used?
>>>> 
>>>> Isn't this the default behaviour of ruby, that you can just reopen a class 
>>>> and add methods to it possibly overriding them but not deleting the rest 
>>>> of the class?
>>>> 
>>>> 
>>>> Regards,
>>>> Luís Ferreira
>>>> 
>>>> 
>>>> 
>>>> --
>>>> You received this message because you are subscribed to the Google Groups 
>>>> "Ruby on Rails: Core" group.
>>>> To post to this group, send email to [email protected].
>>>> To unsubscribe from this group, send email to 
>>>> [email protected].
>>>> For more options, visit this group at 
>>>> http://groups.google.com/group/rubyonrails-core?hl=en.
>>> 
>>> 
>>> -- 
>>> You received this message because you are subscribed to the Google Groups 
>>> "Ruby on Rails: Core" group.
>>> To post to this group, send email to [email protected].
>>> To unsubscribe from this group, send email to 
>>> [email protected].
>>> For more options, visit this group at 
>>> http://groups.google.com/group/rubyonrails-core?hl=en.
>> 
>> Cumprimentos,
>> Luís Ferreira
>> 
>> 
>> 
>> 
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Ruby on Rails: Core" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to 
>> [email protected].
>> For more options, visit this group at 
>> http://groups.google.com/group/rubyonrails-core?hl=en.
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Core" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/rubyonrails-core?hl=en.

Cumprimentos,
Luís Ferreira



-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en.

Reply via email to