From b15e6d83053c4c2ea175a85b554cefa6b6c13b63 Mon Sep 17 00:00:00 2001 From: Andrew Smith Date: Sun, 26 Feb 2012 11:42:25 +0000 Subject: [PATCH] Fix duplicated 'back_url' IDs Various hidden input fields are used to hold a URL to send the user back to the correct page after submitting a form, however, they all use the same ID which isn't allowed in HTML. Passing in 'id' as nil stops the 'hidden_field_tag' from adding an ID attribute to the tag. --- app/helpers/application_helper.rb | 2 +- app/views/account/_login.rhtml | 2 +- app/views/issues/_list.rhtml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index af424852..3528957c 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -851,7 +851,7 @@ module ApplicationHelper def back_url_hidden_field_tag back_url = params[:back_url] || request.env['HTTP_REFERER'] back_url = CGI.unescape(back_url.to_s) - hidden_field_tag('back_url', CGI.escape(back_url)) unless back_url.blank? + hidden_field_tag('back_url', CGI.escape(back_url), :id => nil) unless back_url.blank? end def check_all_links(form_name) diff --git a/app/views/account/_login.rhtml b/app/views/account/_login.rhtml index b27e979b..44027a38 100644 --- a/app/views/account/_login.rhtml +++ b/app/views/account/_login.rhtml @@ -1,6 +1,6 @@