Skip to content

Instantly share code, notes, and snippets.

These are not the same
@bikes.each { |b| puts b.inspect }
@bikes.inspect
{
"env":{
"PATH":"${HOME}/.rvm/bin:${PATH}"
},
"cmd": ["rvm-auto-ruby", "$file"],
"file_regex": "^(...*?):([0-9]*):?([0-9]*)",
"selector": "source.ruby"
}
@railyboy
railyboy / app_data.rb
Created September 12, 2012 11:20
Loading .yml configuration data with the code from http://speakmy.name/2011/05/29/simple-configuration-for-ruby-apps
module AppData
#require 'deep_symbolizable'
# again - it's a singleton, thus implemented as a self-extended module
extend self
@_settings = {}
attr_reader :_settings
@railyboy
railyboy / _form.html.erb
Created June 25, 2012 12:17
How to use bootstrap-datepicker-rails with Bootstrap-Sass gem
<%= form_for(@person) do |f| %>
<% if @person.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@person.errors.count, "error") %> prohibited this person from being saved:</h2>
<ul>
<% @person.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>