Top "Erb" questions

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

How do I include HTML in a JS Rails response?

I have a FooController that responds to HTML and JS (AJAX) queries: # app/controllers/foo_controller.rb: class FooController < …

javascript ruby-on-rails ruby erb
Rails ERB <%- ... -%> vs. <% ... %>

Possible Duplicate: Difference between -%> and %> in rails So for an ERB file, what's the difference between <%…

ruby-on-rails erb
Rails 3: How to render ERb template in rake task?

I am rendering a pretty huge sitemap HTML file with rake. Unfortunately, the code breaks when I migrate to rails 3. …

ruby-on-rails-3 rake erb
In Rails, how can I allow some html in a text area?

I have a Rails app (blog) that I am creating. Very basic stuff. In my content area I have a …

html ruby-on-rails formatting erb
Dynamic class name in HAML

Is there a better way to convert the following to HAML? <% flash.each do |key, value| %> <div …

haml erb
Pass Rails JSON variable to javascript variable

I have a Global JSON variable in my Ruby on Rails controller. It looks like this @rails_side_json = { :name =&…

javascript ruby-on-rails json erb
Rails ERb best practices (<% %> vs <% -%> vs <%- -%>)

What is the recommended use of ERb in Rails when it comes to <% %> (evaluate Ruby code), <% -%&…

html ruby-on-rails ruby erb evaluate
Passing binding or arguments to ERB from the command line

I have been playing around with erb from the command line recently. I wanted to make a dirt simple erb …

ruby templates erb
How to set html on data-disable-with to rails submit_tag

I have a RoR app using bootstrap. I'm trying to apply the fontawesome html icon tag to a submit_tag …

html twitter-bootstrap ruby-on-rails-4 erb
Sass with erb won't compile

In Rails, file file.css.sass.erb: .class-name width: <%= "10px" %> Is throwing the error: Invalid CSS after "": expected …

ruby-on-rails ruby sass asset-pipeline erb