4

Using Ruby 1.9.2 and Rails 3 -

When attempting to use <%= error_messages_for 'story' %> I get this error:

DEPRECATION WARNING: error_messages_for was removed from Rails and is now available as a plugin. Please install it with `rails plugin install git://github.com/rails/dynamic_form.git`. (called from _app_views_stories_new_html_erb__1042605186_33967248__100840187 at C:/Ruby192/shovell/app/views/stories/new.html.erb:1) 

So I did what it said and ran the plugin install. However now I have an empty dynamic_form folder at vendor/plugins. I tried using http instead of git with no luck. I also added a / at the end of the URL which worked for someone else online, but with no luck.

I added gem dynamic_form to the Gemfile and require "dynamic_form" to the application.rb as well as rerun bundle install. It shows that dynamic_form-1.1.3 is installed to `lib/ruby/gems/1.9.1/gems/' but I am still getting the same error.

tehaaron
  • 2,250
  • 10
  • 31
  • 54
  • 1
    If you're having trouble using the normal git install, you can probably just download from github, and extract to vendor/plugins. Alternatively, if you're installing as a gem, you should be adding `gem 'dynamic_form'` to your `Gemfile` and running bundle install, that's how specifying gems and requiring them works in rails 3. – Jeremy Nov 05 '10 at 04:48
  • I downloaded the source from Github and had no luck...is the source the right collection or is there a singular file somewhere that i missed? As for the Gem part, that is exactly what I did,as I mentioned, but it didn't seem to recognize it. – tehaaron Nov 05 '10 at 05:16

2 Answers2

4

In my case, I was trying to use dynamic_form inside of a Rails Engine that I was building.

I simply added the gem 'dynamic_form' into my Gemfile, did a bundle install and added

require 'dynamic_form'

inside my lib/libname.rb. Restarted the app, and all was well.

Aaron Hinni
  • 14,578
  • 6
  • 39
  • 39
2

The solution was as Jeremy pointed out, to simply download rails/dynamic_form on github and extract it to vendor/plugins and rename the folder "dynamic_form". The reason it didn't work for me before was because I was using someone else's modified version of dynamic form and of course not specifying it.

tehaaron
  • 2,250
  • 10
  • 31
  • 54