Thanks James,

the :plugin => "my_plugin" did it.

Another quick question.

I am running into an issue with my CSSs which are refering to images...
obviously when the plugin gets loaded the CSS image URL doesn't hold any
longer.

I figured using RCSS might help fix this (since I can use the
image_tab="image", plugin => "plugin" notation to refer to images) BUT the
some of the RCSS techiques I've looked at use a special route:

map.connect 'rcss/:rcss.:format', :controller => 'rcss', :action =>
'dispatch'

So putting this route in a stand alone app works fine, but once I try to
refer to rcss files located in the view/rcss folder of my plugin all hell
breaks loose.

The comment by the technique author is that this route statement should go
before the default routes in the app's route.rb

What I tried:
1. route in app's route.rb (complains that controller is not found)
2. route and controller in main app (complains view isn't there)
3. route.rb in root of plugin (no special route loaded)
4. added the map.from_plugin :my_plugin in the main app's route.rb (no
special route loaded)


Thanks James!

On 2/22/07, James Adam <[EMAIL PROTECTED]> wrote:

Hi Hugo,

Are you using the engines 1.2 release? If so, check the UPGRADING file....

- James

On 2/22/07, Hugo Levasseur <[EMAIL PROTECTED]> wrote:
> Hey James,
>
> Thanks for the tips.
>
> Actually my problem was resolved using a combination of
alias_method_chain
> and config.plugin = [ "engine", "*"].
>
> I ran into another small problem ...
>
> Trying to use another application that I built as a plugin, I found that
the
> stylesheets don't get loaded.
>
> I tried to invoke them using <%= "engine_stylesheet 'stylesheet' %> but
that
> returns an error saying that engine_stylesheet is undefined...
>
> Any clues?
>
> Thanks
>
> Hugo
>
>
> On 2/21/07, James Adam <[EMAIL PROTECTED]> wrote:
> > Hi Hugo,
> >
> > Using alias_method_chain is normally quite easy, but if you're doing
> > it from within a module you need to be sure that the
> > "alias_method_chain" call is made on the base class when it's included
> > - see the top of
> >
> engines/lib/engines/rails_extensions/rails_initializer.rb
> for an
> > example - I'm using base.class_eval to make the calls to
> > alias_method_chain as if they were in the including class itself.
> >
> > My guess is that it's something like this which is stopping your
> > methods being called - have a play around and if you're still not
> > making any progress, email us the code and we'll take a look.
> >
> > Cheers and thanks for the nice comments :)
> >
> > James
> >
> > On 2/20/07, Hugo Levasseur <[EMAIL PROTECTED] > wrote:
> > > Hi guys,
> > >
> > > I am a member of Steve's team (he posted last month about the 1.2
> branch).
> > >
> > > 1st Thanks for the amazing work to James!  Engines is an amazing
piece
> of
> > > work.
> > >
> > > To the question then:
> > >
> > > I would need to be able to override a Rails Initializer method
> > > (find_plugins).
> > > I noticed that the rails_initializer.rb file contains the
> > > Engine::RailsExtensions::RailsInitializer which,
> according
> > > to its leading comment, attempts to override 3 Initializer methods.
> > >
> > > I therefore tried to put my "modified" version of find_plugins using
the
> > > conventions found in the
> > > Engine::RailsExtensions::RailsInitializer:
> > >
> > > 1. using 'alias_method chain' : find_plugins, :engine_additions
> > >
> > > 2. writing a method called
> > > 'find_plugins_with_engine_additions' with a slightly
> > > modified body.
> > >
> > >
> > > The problem is that it doesn't seem to be invoked at any time
(neither
> does
> > > the 'load_plugin_with_engine_addition).
> > >
> > > Could you let me know how and where it should be invoked / included
to
> > > overwrite this Initializer method
> > >
> > > Thanks!
> > > _______________________________________________
> > > engine-developers mailing list
> > > [email protected]
> > >
>
http://lists.rails-engines.org/listinfo.cgi/engine-developers-rails-engines.org
> > >
> > >
> >
> >
> > --
> > * J *
> >   ~
> > _______________________________________________
> > engine-developers mailing list
> > [email protected]
> >
>
http://lists.rails-engines.org/listinfo.cgi/engine-developers-rails-engines.org
> >
>
>
> _______________________________________________
> engine-developers mailing list
> [email protected]
>
http://lists.rails-engines.org/listinfo.cgi/engine-developers-rails-engines.org
>
>


--
* J *
  ~
_______________________________________________
engine-developers mailing list
[email protected]

http://lists.rails-engines.org/listinfo.cgi/engine-developers-rails-engines.org

_______________________________________________
engine-developers mailing list
[email protected]
http://lists.rails-engines.org/listinfo.cgi/engine-developers-rails-engines.org

Reply via email to