Hi all,
I have an issue with getting a plugin to work, namely Scaffolding Extensions. It used to work fine with webrick, but seems to have stopped working around the time that I moved the app to apache. Now it doesn't work with either server.
I'm not suggesting that the problem is due to apache - I might have done something else around the time to break the extension, but not sure what.
I even deleted the plugin from vendor/plugins and re-installed it - I can see the files in vendor/plugins/scaffolding_extensions
antony@lee:~/workspace/marketing/vendor/plugins$ find -name init.rb
./scaffolding_extensions/init.rb
./mdd/init.rb
antony@lee:~/workspace/marketing/vendor/plugins$
But my one-line controller doesn't work. The only call is to scaffold_all_models and webrick and apache both report:
"NameError -undefined local variable or method `scaffold_all_models' for AdminController:Class"
I'd really appreciate any help debugging this.
Antony
From the error message it appears as though rails isn't loading the
plugin file. First off, which version of Rails are you using? I only
test the plugin with 1.1.6. Is the mdd plugin you are using working?
Could you post your contents of your controller file?
Run this command in the Rails app:
script/runner "puts
ActionController::Base.methods.sort.delete_if{|m| m !~ /^scaffold/ }"
You should get this output:
scaffold
scaffold_all_models
scaffold_auto_complete_for
scaffold_habtm
scaffold_method
scaffold_path
scaffold_template_dir
If not, the plugin isn't being loaded properly. Check your ruby load
path includes the plugin:
$ script/runner "puts $:" | grep scaffolding_extensions
script/../config/../vendor/plugins/scaffolding_extensions/lib
If not, you can try running script/console, manually modifying the
load path and then requiring 'scaffolding_extensions', and then seeing
if the scaffolding methods have been added.
As a last resort, try creating an empty Rails project and adding the
plugin to it to see if it works.
Jeremy