Erubis not calling to_s

2 views
Skip to first unread message

Phrogz

unread,
Sep 5, 2008, 3:17:08 PM9/5/08
to Ramaze
Hi there; I'm new to Ramaze, but not Ruby or web development. Please
feel free to be harsh if this is a silly mistake. :)

I have started with the standard site template created by Ramaze, and
changed controller/main.rb to have "engine :Erubis" in the
MainController. When I place "<%=66%>" into page.xhtml, I get an
uppercase "B" character output instead of the string "66". (66.chr ==
"B")

(Similarly, if I have <%=nil%> I get an error, while <%=nil.to_s%>
yields an empty string.)

I'm familiar with Erb, but not Erubis. Is this a feature/performance
optimization of Erubis?
Do I need to change the extension of page.xhtml to something else?

How can I get standard Erb templating to work?

jesusisramaz...@geoshell.com

unread,
Sep 6, 2008, 9:19:53 AM9/6/08
to ram...@googlegroups.com
2008/9/5 Phrogz - phr...@mac.com:

> MainController. When I place "<%=66%>" into page.xhtml, I get an
> How can I get standard Erb templating to work?

Now and again, new users get bitten by this. Ramaze selects the
template engine to use based on template file extension. xhtml is for
Ezamar. Try using rthml.

http://github.com/manveru/ramaze/tree/master/lib/ramaze/template/ezamar.rb#L14
http://github.com/manveru/ramaze/tree/master/lib/ramaze/template/erubis.rb#L14

--
Pistos
http://blog.purepistos.net

Reply all
Reply to author
Forward
0 new messages