Skip to content

Instantly share code, notes, and snippets.

@nodunayo
nodunayo / rails_errors
Created Dec 25, 2013
Rails error message notifications
View rails_errors
#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 Dec 2, 2018 — forked from zenorocha/README.md
A template for a code hospitable README
View README.md

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 Aug 31, 2016
A race to green for the 99 Bottles Kata
View bottles.rb
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.