Skip to content

Instantly share code, notes, and snippets.

@nodunayo
nodunayo / rails_errors
Created December 25, 2013 02:01
Rails error message notifications
#place immediately under 'form_for' line
<% if @item.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@item.errors.count, "error") %> prohibited this item from being saved:</h2>
<ul>
<% @item.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
@nodunayo
nodunayo / README.md
Last active December 2, 2018 16:15 — forked from zenorocha/README.md
A template for a code hospitable README

Code Hospitality Guide App

This app helps you transform your team and codebase into code hospitable entities.

Installation

  • Go to the Code Hospitality homepage
  • Click the 'DOWNLOAD RIGHT NOW' button
  • Twiddle thumbs
  • Enjoy
@nodunayo
nodunayo / bottles.rb
Last active August 31, 2016 08:29
A race to green for the 99 Bottles Kata
class Bottles
def verse(number)
if number == 2
<<-VERSE
2 bottles of beer on the wall, 2 bottles of beer.
Take one down and pass it around, 1 bottle of beer on the wall.
VERSE
elsif number == 1
<<-VERSE
1 bottle of beer on the wall, 1 bottle of beer.