Can embedded ruby (erb) be used outside of rails in regular webpages to dynamically update content (almost as a replacement for PHP)?
+2
A:
Yes, as long as the pages are processed by a Ruby interpreter.
For instance, the Sinatra framework uses ERB along with other template languages such as HAML and Erubis.
Simone Carletti
2010-09-15 21:43:15
+1
A:
Yes. Simply via CGI: http://wiki.railsplayground.com/railsplayground/show/How+To+Use+RHTML+without+rails
gertas
2010-09-15 21:45:05
+2
A:
erb is part of the ruby standard library. I would recommend using erubis if possible though, since it is significantly faster (about 3x)
Matt Briggs
2010-09-15 21:47:48
A:
In Ruby off the Rails, one person describes using ERB in a not just non-Rails, but a non-web context - using it to generate text files. I don't know how often people take that approach though.
Andrew Grimm
2010-09-15 23:34:45