From bd51dbdc61125cd2b042d092da322aacb8267471 Mon Sep 17 00:00:00 2001 From: Mark Yoon Date: Fri, 8 Mar 2013 20:35:52 -0600 Subject: [PATCH] modified syntax of data attributes for rails 3.0. #415 --- CHANGELOG.md | 1 + lib/surveyor/helpers/surveyor_helper_methods.rb | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f71c759e..b4d6c298 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ History for Surveyor - Upgrade reset css - Added surveyor_translations table to support YAML-based localizations of surveys. (#420) - Add extension point for pre-JSON-export survey modifications (#416) +- Add input mask for text entry fields (#415) ### Fixes diff --git a/lib/surveyor/helpers/surveyor_helper_methods.rb b/lib/surveyor/helpers/surveyor_helper_methods.rb index ed149c17..54f15ef6 100644 --- a/lib/surveyor/helpers/surveyor_helper_methods.rb +++ b/lib/surveyor/helpers/surveyor_helper_methods.rb @@ -82,10 +82,8 @@ def generate_pick_none_input_html(value, default_value, css_class, response_clas html[:value] = default_value if value.blank? html[:disabled] = disabled unless disabled.blank? if input_mask - data = {} - data['input-mask'] = input_mask - data['input-mask-placeholder'] = input_mask_placeholder unless input_mask_placeholder.blank? - html[:data] = data + html[:'data-input-mask'] = input_mask + html[:'data-input-mask-placeholder'] = input_mask_placeholder unless input_mask_placeholder.blank? end html end