私は私のレイアウトファイル(_header.html.erb)のいずれかで私のエラー(フラッシュと工夫の両方)を表示しようとしています:devise rails - 別のビューでのエラーメッセージ?
<div id="alerts">
<% flash.each do |name, msg| %>
<%= content_tag :div, msg, :id => "flash_#{name}" if msg.is_a?(String) %>
<% end %>
<%= devise_error_messages! %>
</div>
が、私はエラーになっています:未定義のローカル変数やメソッドを`resource 'エラーメッセージはもはやdevise形式ではないためです。私はここに示唆された方法を試みた:http://pupeno.com/2010/08/29/show-a-devise-log-in-form-in-another-page/そのコードをapplication_controller.rbファイルに貼り付けることによって。運がない。アイデア?
oh。
it 'succeeds with a valid email and password' do
user = Factory.create(:user)
visit sign_in_path
fill_in 'user_email', :with => user.email
fill_in 'user_password', :with => user.password
click_button 'Sign in'
page.should have_content("hi #{user.username}")
end
これはFYI、Rails3である:私はここで失敗するテストです...言及するのを忘れてしまった...ページがエラーなしで動作しますが、私のテストが失敗しています。