Skip to content

Instantly share code, notes, and snippets.

View rchampourlier's full-sized avatar

Romain Champourlier rchampourlier

View GitHub Profile
@rchampourlier
rchampourlier / example_spec.rb
Created August 14, 2012 14:46 — forked from henrik/example_spec.rb
Testing Draper decorators with real helpers, including URL helpers.
require "spec_helper"
# :draper_with_helpers is necessary for the Draper objects
# to access real helpers, including URL helpers, in the spec.
describe MyDecorator, "#foo", :draper_with_helpers do
# This is necessary for the spec itself to use URL helpers
# like some_path().
include Rails.application.routes.url_helpers
@rchampourlier
rchampourlier / _flash.html.haml
Created June 7, 2012 09:27 — forked from potomak/_flash.html.erb
Rails flash messages using Twitter bootstrap
- if flash
- flash.each do |level, message|
%div{:class => "alert #{flash_level(level)}"}
%button.close{:"data-dismiss" => 'alert'}= "×"
= message