Top "Erb" questions

ERB is a simple templating system for Ruby, embedding code in any plain-text document.

Is there a way to use a Ruby loop inside of HAML's :javascript region?

Inside of HAML, can we have a loop inside the :javascript region? This will work: - 10.upto(20) do |i| :javascript …

javascript ruby loops haml erb
Add class to custom form_for label

How do I add a custom class to a form_for else statement? <%= form_for(@user) do |f| %> . . . &…

ruby-on-rails ruby erb form-for
How can I syntax check (not render) a Rails 3 ERB template file?

I'm trying to have a git pre-commit hook perform a syntax check on all Ruby code; there is one on …

ruby-on-rails ruby-on-rails-3 erb
How do I use .html.erb as a file extension for my views with Sinatra?

If I have the following Sinatra code: get '/hi' do erb :hello end This works great if I have …

ruby sinatra erb
Rails plain text template

I'd like to render an ERB template into plain text in Rails. Ideally, I'd be able to do something like …

ruby-on-rails erb