views:

18

answers:

1

I followed the Rails guide to make a plugin which makes an acts_as_* with helpers and controllers.

I also would like to use partial views.

I could not find a way to make the plugin's helpers' render :partial => ... directives search within the plugin's directory structure (e.g. vendor/plugins/<my plugin>/lib/app/views directory. It always looks in the <project root>/app/views.

I don't like either of the three solutions I have come up with so far: (a) when the plugin is installed, copy its views to <project root>/app/views -- I want to keep the plugin separate from the project (b) render the view code from the helper -- this is messy (c) use a relative path with render calls (../../vendor/plugins/<plugin name/lib/app/views/<partial name>) -- seems "wrong".

It's not necessary to look at it, I don't think, but the code is here: http://github.com/jrmurad/Virtual-Restaurant. The plugin (which will eventually be its own project on github when this issue is resolved) is called sortable_nested_set.

Similarly, I worked around not being able to have javascript (.js.erb) for the controllers' format.js by using render :update do |page| from the plugin.