From 15942552518f65120e7fc7754763ee992e55b11e Mon Sep 17 00:00:00 2001 From: cktricky Date: Mon, 26 May 2014 13:51:20 -0400 Subject: [PATCH 1/2] added coerceToString sot hat hogan functions properly --- app/assets/javascripts/application.js | 4 ++++ app/views/sessions/new.html.erb | 1 + 2 files changed, 5 insertions(+) diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 86053f0..902f1e8 100755 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -53,6 +53,10 @@ $("pre.javascript").snippet("javascript",{style:"rand01",transparent:true,showNu }; +function coerceToString(val) { + return String((val === null || val === undefined) ? '' : val); +} + var rAmp = /&/g, rLt = //g, diff --git a/app/views/sessions/new.html.erb b/app/views/sessions/new.html.erb index eb80c99..c22de2b 100755 --- a/app/views/sessions/new.html.erb +++ b/app/views/sessions/new.html.erb @@ -10,6 +10,7 @@ var paramValue = hashParam.split('=')[1]; document.write(""); } catch(err) { + alert(err); } //document.write(""); From 85959540964ae77b30f53227e7c137688a559d9b Mon Sep 17 00:00:00 2001 From: cktricky Date: Mon, 26 May 2014 16:58:26 -0400 Subject: [PATCH 2/2] removed alert when an error is thrown --- app/views/sessions/new.html.erb | 1 - config/application.rb | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/app/views/sessions/new.html.erb b/app/views/sessions/new.html.erb index c22de2b..eb80c99 100755 --- a/app/views/sessions/new.html.erb +++ b/app/views/sessions/new.html.erb @@ -10,7 +10,6 @@ var paramValue = hashParam.split('=')[1]; document.write(""); } catch(err) { - alert(err); } //document.write(""); diff --git a/config/application.rb b/config/application.rb index 2c89c24..25ef3f4 100755 --- a/config/application.rb +++ b/config/application.rb @@ -40,7 +40,7 @@ module Railsgoat config.filter_parameters += [:password] # Enable escaping HTML in JSON. - #config.active_support.escape_html_entities_in_json = false + #config.active_support.escape_html_entities_in_json = true # Use SQL instead of Active Record's schema dumper when creating the database. # This is necessary if your schema can't be completely dumped by the schema dumper,