Friday, 15 June 2012

Do I need to require original file when overriding controller from Rails Engine? -


I am trying to override an action in a controller defined by a rail engine.

It seems like I need the original file before reopening the class, like:

  is a file needed. Joint (RRR_RO, 'vendor / Plugins / myopologins / apps / controllers / some_controllers' classes) Some Controller Def Indexing: Text = & gt; 'This is my index' end of the end  

It is understandable, but its requirement is very ugly. Is there any rail magic which can allow me to avoid the preliminary requirement?

It seems to be a complete ...

A load time problem Looks like your file is loading before the plug-in Where is your action located? Config / initializers? Liberalization?

I'm not sure when the train engines are loaded, play with this place (it should work in Lib).

Or, better yet, plug-in with the changes themselves and make sure it loads after the original.

And maybe you want something else:

  SomeController.class_eval def index ... and end  

No comments:

Post a Comment