Top "Erb" questions

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

How do I run multiple lines of Ruby in html.erb file

I'm using Ruby on Rails and need to run a block of Ruby code in one of my html.erb …

ruby-on-rails ruby block erb
Convert existing html.erb to Haml

I have a rails project, the views only consist with HTML.ERB files, my client wants to convert ERB to …

ruby-on-rails haml erb
Disable HTML escaping in erb templates

In a Rails 3 application I have a domain class where one attribute stores pure HTML content (it's a blog app, …

ruby-on-rails-3 escaping erb
How do I check if a variable is defined in rails?

<% if dashboard_pane_counter.remainder(3) == 0 %> do something <% end> If dasboard_pane_counter wasn't defined, how can …

ruby-on-rails ruby erb
"undefined method `errors' for nil:NilClass" when calling on errors method

I am currently teaching myself some RoR and doing the tutorial, but adding some nicer layout and stuff with bootstrap …

ruby-on-rails erb
Including one erb file into another

I'm writing a command-line tool that will ultimately output an HTML report. The tool is written in Ruby. (I am …

ruby erb templating
Rails: access controller instance variable in CoffeeScript or JavaScript asset file

In Rails 3.1 it is not possible to access controller instance variables in an asset js.erb or coffee.erb file …

ruby-on-rails controller coffeescript erb instance-variables
Conditional tag wrapping in Rails / ERB

What would be the most readable and/or concise way to write this in ERB? Writing my own method isn't …

ruby-on-rails ruby erb
Rails button_to - applying css class to button

This is silly, but I just can't figure out how to style the input element created by Rails button_to …

ruby-on-rails forms erb button-to
using HTML5 video tag in a simple rails app

inside index.html.erb there is the following code <video width="320" height="240" controls="controls"> <source src="truffle1.…

ruby-on-rails html video routing erb