NetManiac

Witold Rugowski on web20 wave with Ruby on Rails

Mixing h() helper and plain output in rhtml

Posted on October 22, 2006 - Filed Under RubyOnRails

Sometimes You need to generate output from .rhtml templates with HTML tags escaped mixed with real HTML tags. You can open and close Ruby code tags ( <%= <%=h ) but there is simpler method. In <%= block call h() helper directly. To work You need show correct name space – and this is ERB::Util::h().

Popularity: 4% [?]

Hits for this post: 4961

Similar Posts

Comments

Leave a Reply