Supposedly installing erubis is as simple as:
gem install erubis
# And in environment.rb:
require 'erubis/helpers/rails_helper'
But I haven't found this to be so. Note that there are no evident errors in my code; it runs just fine and dandy with ERB.
Where do I put this line? Directly after the boot.rb inclusion it fails to start...
Just upgraded Rails to 2.3.5 to get the lovely looking rails_xss plugin but I've noticed one big issue with it. Any content_for blocks are escaped when yielded.
I've tried hacking it around by doing the either of following but they do not work:
<% @content_for_foo.html_safe! -%>
<%= yield raw :foo %>
...
I have a couple of block helpers, here's a simple example of what I'm doing:
def wrap_foo foo, &block
data = capture(&block)
content = "
<div class=\"foo\" id=\"#{foo}\">
#{data}
</div>"
concat( content )
end
I'm just trying out erubis and it's giving me the following error:
You have a nil object when...
Hi all,
I have a ruby class that extends Erubis (a ruby templating engine) and I would like to create my own tags. The following is an example of what i'd like to be reproduce:
<%= link_to "/some/url" %>
This code should generate a html 'a' tag linking to some url. Now i'd like to be able to create my own tags such as:
<%= javascrip...
I have several frequent Cron jobs that are run via Rake and the output of those jobs are e-mailed (via a MAILTO). Due to the fact that these tasks load the Rails environment (which includes Erubis) they always prints out "** Erubis 2.6.5" on startup. This means that an e-mail is always generated since Cron receives output. Is there an...
I just discovered Erubis, a replacement for the default view renderer for Ruby on Rails. However, from what I can tell from reading about it, it's superior across the board.
It is much faster.
It has many more options.
It can prevent cross site scripting without having to use h.
Does this have any disadvantages versus the standard erb ...
i found out erubis, the "fast, secure, and very extensible implementation of eRuby",
now after install through gem install erubis, my question is how to run in on mac?
especially on mamp?
i been no luck finding answer on google so anyone know how?
...