▁this ▁line : ▁ ▁gem ▁' ham l ' ▁ ▁Similar ▁to ▁e R uby , ▁Ham l ▁also ▁can ▁access ▁local ▁variables ▁( dec la red ▁within ▁same ▁file ▁in ▁Ruby ▁code ). ▁This ▁example ▁uses ▁a ▁sample ▁Ruby ▁controller ▁file . ▁ ▁file : ▁app / cont rollers / messages _ controller . rb class ▁Mess ages Controller ▁< ▁Application Controller ▁▁ ▁def ▁index ▁▁▁▁ ▁@ message ▁= ▁" Hello , ▁World !" ▁▁ ▁end ▁end ▁ ▁file : ▁app / views / messages / index . html . ham l # wel come ▁▁▁▁ ▁% p = ▁@ message ▁ ▁This ▁rend ers ▁to : ▁< div ▁id =" wel come "> ▁▁▁▁ ▁< p > Hello , ▁World ! </ p > ▁</ div > ▁ ▁Ham l ▁as ▁a ▁Ruby ▁module ▁To ▁use ▁Ham l ▁independent ▁of ▁Rails ▁and ▁Action View , ▁install ▁h aml ▁gem , ▁include ▁it ▁in ▁Gem file ▁and ▁simply ▁import ▁[ Usage : ▁require ▁' ham l '] ▁it ▁in ▁Ruby ▁script ▁or ▁invoke ▁Ruby ▁interpreter ▁with ▁- ruby gems ▁flag . ▁ ▁welcome ▁= ▁Ham l :: Engine . new ("% p ▁Hello , ▁World ! ") ▁welcome . render ▁Output : ▁ ▁< p > Hello , ▁World ! </ p > ▁ ▁Ham l :: Engine ▁is ▁a ▁Ham l ▁class . ▁ ▁Basic ▁example ▁Ham l ▁uses ▁whitespace ▁ind entation ▁( two ▁spaces ) ▁for ▁tag ▁nest ing ▁and ▁scope . ▁This ▁acts ▁as ▁a ▁replacement ▁for ▁the ▁open