From 12e6fd9cb58ea43ea4b79ec38b197b21b752d352 Mon Sep 17 00:00:00 2001 From: Chrisbr Date: Sat, 10 May 2014 17:52:26 +0200 Subject: [PATCH] Bugfix to pass feature test - check if session[:return_to] is nil - adds unique html ids for dropdown login fields --- app/controllers/application_controller.rb | 3 ++- app/views/layouts/_navigation.html.haml | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 077f2073..12c0e8e0 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -9,7 +9,8 @@ class ApplicationController < ActionController::Base end def after_sign_in_path_for(resource) - if not session[:return_to].start_with?(user_registration_path) + if session[:return_to] and + not session[:return_to].start_with?(user_registration_path) logger.debug "Returning to #{session[:return_to]}" session[:return_to] else diff --git a/app/views/layouts/_navigation.html.haml b/app/views/layouts/_navigation.html.haml index 404ed23d..cedea71f 100644 --- a/app/views/layouts/_navigation.html.haml +++ b/app/views/layouts/_navigation.html.haml @@ -47,8 +47,8 @@ %span.caret .dropdown-menu{:style => "padding: 17px;"} = form_tag user_session_path do - = text_field_tag 'user[email]' - = password_field_tag 'user[password]' + = text_field_tag 'user[email]', nil, id: 'user_email_dd' + = password_field_tag 'user[password]', nil, id: 'user_password_dd' %label.checkbox = check_box_tag 'user[remember_me]' Remember me