Devise displaying Warning
I set up a simple Authentication system based on Railscasts #209 and #210.
When i type http://localhost:3000/users/registration/sign_up
, the signup page is displayed.But, a warning accompanies it:
DEPRECATION WARNING: f.error_me开发者_Go百科ssages 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 realtime at C:/Ruby192/lib/ruby/1.9.1/benchmark.rb:309)
How can i fix this issue? Also, how to customize this route in devise? something like localhost:3000/sign_up is a lot better.
OK, well, to answer your first question, you can either install the plugin as detailed in the error message or you can do something like this:
<%- @user.errors.full_messages.each do |message| -%>
<p><%= message %></p>
<%- end -%>
Basically, it'll run through all the messages and print them out.
To answer your second question, you can do something like this in your routes.rb:
devise_for :users
devise_scope :user do
get '/login' => 'devise/sessions#new'
get '/logout' => 'devise/sessions#destroy'
end
精彩评论