Tags
array bash benchmark bug chrome cli configuration css diy editorial firefox fixes gotcha grub hack hardware html5 input instance_eval javascript jquery jsperf linux mouse multi touch multitouch nginx opera performance preferences prototype ruby snippet ssh syntax touch pad touchpad trackpad track pad ubuntu udev virtualbox web standards wii windowsCategories
-
Recent Posts
Recent Comments
- Chema Gallego on Clone Ubuntu VMs in VirtualBox
- Ryan Finnie on Compacting a VMDK (Virtual Machine Disk Format image)
- Prevent Virtual Machines from Saving Network Interface udev Rules | splat operator on Clone Ubuntu VMs in VirtualBox
- David on Ruby instance_eval gotcha
- force on Clone Ubuntu VMs in VirtualBox
Archives
Meta
Tag Archives: instance_eval
Render a template from a hash in Ruby
A hash is a great way to manage a list of key/value pairs, and templates are a great way to render content. So here’s a simple way to render a template from a hash. template.erb My favorite color is <%= … Continue reading
Posted in ruby
Tagged binding, context, erb, hash, instance_eval, openstruct, ruby, template
Leave a comment
Ruby instance_eval gotcha
I don’t know how much of a “gotcha” this is since it’s just a defined behavior and feature of the language, but I still found it a little counterintuitive when I encountered it, and I had to actually read the … Continue reading