2011-01-11 9 views
0

エラーが発生しました。DEPRECATION WARNING:error_messages_forがRailsから削除され、プラグインとして使用できるようになりました。 rails plugin install git://github.com/rails/dynamic_form.gitでインストールしてください。 (Cで_app_views_user_register_html_erb__195833478_79197384_0から呼び出さ:/Users/rod/connect-my-friends/app/views/user/register.html.erb:5)Rails 3エラーメッセージ

私はプラグインを持って、熊手をしましたが、私はまだエラーが出ます私は何か正しいことをしなかったのですか?ここ

ページコードが

<%= form_for :user do |form| %> 
<fieldset> 
    <legend>Enter Your Details</legend> 
    <%= error_messages_for "user" %> 
    <div class="form_row"> 
    <label for="screen_name">Screen name:</label> 
    <%= form.text_field :screen_name, 
     :size => User::SCREEN_NAME_SIZE, 
     :maxlength => User::SCREEN_NAME_MAX_LENGTH %> 
    </div> 

のように見えるものである私は、屋頼むより必要と私はこれを編集して

require File.expand_path('../boot', __FILE__) 

require 'rails/all' 

# If you have a Gemfile, require the gems listed there, including any gems 
# you've limited to :test, :development, or :production. 
Bundler.require(:default, Rails.env) if defined?(Bundler) 

module ConnectMyFriends 
    class Application < Rails::Application 
    # Settings in config/environments/* take precedence over those specified here. 
    # Application configuration should go into files in config/initializers 
    # -- all .rb files in that directory are automatically loaded. 

    # Custom directories with classes and modules you want to be autoloadable. 
    # config.autoload_paths += %W(#{config.root}/extras) 

    # Only load the plugins named here, in the order given (default is alphabetical). 
    # :all can be used as a placeholder for all plugins not explicitly named. 
    # config.plugins = [ :exception_notification, :ssl_requirement, :all ] 

    # Activate observers that should always be running. 
    # config.active_record.observers = :cacher, :garbage_collector, :forum_observer 

    # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. 
    # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. 
    # config.time_zone = 'Central Time (US & Canada)' 

    # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. 
    # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] 
    # config.i18n.default_locale = :de 

    # JavaScript files you want as :defaults (application.js is always included). 
    # config.action_view.javascript_expansions[:defaults] = %w(jquery rails) 

    # Configure the default encoding used in templates for Ruby 1.9. 
    config.encoding = "utf-8" 

    # Configure sensitive parameters which will be filtered from the log file. 
    config.filter_parameters += [:password] 
    end 
end 

それを追加します、これはすべての場合はそれが十分詳細であるべきと考えています私に新しいので、どのようにそれを配置するかわからないaplaction.rbファイルを追加しました

答えて

1

プラグインを確認してくださいREADME

error_messages_for "user"の代わりにform.error_messagesを使用してください。

その他の推測

--edit:

  • は、インストール後にサーバーを再起動することがありますか?
  • すべてのプラグインをロードしていますか? config/application.rb - >config.pluginsを確認してください。
+0

いいえ私はまだそれをファイルに追加する方法がわからないのですが( –

+0

助けてくれてありがとうございます!)私はサーバを再起動しなければならず、error_messages_for "user"はうまくいきました! –

+0

probs。私は何度も忘れてしまったので再起動したことを覚えています:) – Heikki