Justus Romijn

1

votes
1

answer
515

views

Rails namespace routes with 'as' parameter

I would like to use the :as parameter on a namespaced route, like so: routes.rb map.namespace :banana, :as => 'apple', do |banana| ... end But it seems that the :as parameter is only available to map.resources. Am I missing something, should I refactor my routes? I'm stuck on Rails 2.3.8 for this si...
Justus Romijn
2

votes
2

answer
1.3k

views

How to handle possibly HTML encoded values in javascript

I have a situation where I'm not sure if the input I get is HTML encoded or not. How do I handle this? I also have jQuery available. function someFunction(userInput){ $someJqueryElement.text(userInput); } // userInput '' returns '