ERB - Ruby ERB Script

What is a ERB file

ERB files contain source code written in a programming language of the same name. The ERB language is essentially a Ruby templating language. ERB files are saved in a plain text format which allows them to be opened in any text editing program. Thus, the file can contain any type of text alongside the ERB source code. Code in other programming languages can also be saved in the ERB file.

Even though files with an ERB extension can contain many different types of text and source code, there is a distinctiveness when it comes to ERB code saved in the file. When run with the so-called ERB template engine, the ERB file can be used to add Ruby ERB source code to another document or website file. Since Ruby ERB is more of a templating language, ERB files are also used as templates to create other files. Mainly, these are web files such as HTML, JS or RB.

Here's a small, but not exhaustive list of programs that can open ERB documents:

  • Apple TextEdit (Mac)
  • Microsoft Notepad (Windows)
  • Panic Coda 2 (Mac)
  • Any Text Editor
About
Extension ERB
Useful links