views:

123

answers:

1

I have a rails plugin written in v 2.1.1. When I install it in a 2.2.2 app, it breaks the app. I'm unable to use polymorphic routes so something like

<%= link_to @object %>

Doesn't work, because it says: ActionView::TemplateError (undefined method 'polymorphic_path' for #<ActionView::Base:0x1a95c1c>)

If I script/plugin remove the plugin, it's still broken. So I have a two part question:

  1. What is script/plugin install doing besides just copying the files into vender/plugins. From the output after installing it, it just looks like it's copying the files over, but clearly something else is going on behind the scenes, because removing it doesn't fix the problem

  2. What do I need to do to update this plugin for rails 2.2.2. I don't know much about plugins, but I don't see anything that has specific version code in the plugin itself, so I can't figure out what exactly is breaking and what needs to be updated. Obviously this one is kind of tough to answer without seeing the code, but it's not actually the code in the plugin that's breaking, it's the plugin that is affecting my whole rails config.

Does anyone have experience with upgrading plugins to work for newer versions of rails?

A: 

Turns out the plugin was overwriting the RouteSet::draw method and just needed to be updated to the 2.2.2 draw code :P

brad