Top "Erb" questions

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

raw vs. html_safe vs. h to unescape html

Suppose I have the following string @x = "<a href='#'>Turn me into a link</a&…

ruby-on-rails erb
What is the difference between <%, <%=, <%# and -%> in ERB in Rails?

Can some one please describe the usage of the following characters which is used in ERB file: <% %> <%= %&…

ruby-on-rails ruby templates erb
Block comments in html.erb templates in rails

How do you comment out html mixed with ruby code? some text <% ... %> more text <%= ... %> something else &…

ruby-on-rails ruby erb
Best way to add comments in erb

How do we add comments in erb files, if we do not want them to be generated into the html …

ruby-on-rails ruby erb
How to pass a javascript variable into a erb code in a js view?

I have this Javascript view in my Rails 3 project: app/views/expenses/new_daily.js.erb var i = parseInt($('#…

javascript ruby-on-rails view erb
Include blank for first item in select list in options_for_select tag

I tried :include_blank => true, but it didn't work. <select> <%= options_for_select Model.all.collect{|…

ruby-on-rails ruby-on-rails-3 erb html-select
What is the meaning of erb?

Why is the view of Rails application in the format *.erb.html? What does "erb" mean?

ruby-on-rails ruby erb
Notepad++ not syntax highlighting my files

Until a week ago I was happily coding html.erb files in Notepad++ with syntax highlighting. Then my hard drive …

syntax-highlighting notepad++ erb
Rails if statement syntax

I've written the following ERB and am getting a syntax error at the question mark. This helper function from devise …

ruby-on-rails erb
Ruby templates: How to pass variables into inlined ERB?

I have an ERB template inlined into Ruby code: require 'erb' DATA = { :a => "HELLO", :b => "WORLD", } template = ERB.…

ruby templates syntax erb