草庐IT

特拉诺

全部标签

ruby - 辛纳特拉错误 : Unable to activate sinatra-contrib-1. 4.2

尝试运行Sinatra应用程序时,我不断收到此错误:/Users/matthewsmith/.rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/specification.rb:2064:in`raise_if_conflicts':Unabletoactivatesinatra-contrib-1.4.2,becausetilt-2.0.1conflictswithtilt(~>1.3)(Gem::LoadError)from/Users/matthewsmith/.rbenv/versions/2.1.2/lib/ruby/2.1.0/rub

html - 西纳特拉和 HAML : auto-escape/convert unsafe HTML characters for a whole template?

我有一个小的sinatra应用程序,我用它来运行一个基本的网站。所述网站的内容由客户提供,其中大部分来自PDF。因为我不想手动替换所有与<,和&与&,有没有办法配置HAML/Sinatra自动为我做这件事?基本上,我有一些像这样的block:%plargeblockoftexthere...multi-linesoIcanseeitinmyIDE...morelineshere...我只想找到一些配置选项,告诉HAML遍历所有内容并将不安全的字符替换为对应的HTML实体。我尝试使用HTMLEntitiesgem,但是这个网站有很多多行段落,我似乎无法让它工作。我的意思是我