Questions tagged [rhtml]

HTML-files, with ruby code embedded.

HTML-files, with ruby code embedded, similar to [JSP].

RHTML is HTML mixed with Ruby, using HTML tags. All of Ruby is available for programming alongwith HTML:

Following is the syntax of using Ruby with HTML:

<% %> # executes the Ruby code <%= %> # executes the Ruby code and displays the result

The output of anything in <%= %> tags is directly copied to the HTML output stream. To secure against HTML injection, use the h() function to html_escape the output

For example::

31 questions
0
votes
2 answers

Emacs and embedded ruby <% %> tags

I'm looking for a way to quickly put <% %> tags on the marked region. I'm using rinari with rhtml-mode. I want to do such a thing (I'm in rhtml-mode): I've got a ruby code for example a.each do |e| puts e end and I'm selecting it with…
1 2
3