Skip to content

Instantly share code, notes, and snippets.

Avatar

Romain Champourlier rchampourlier

View GitHub Profile
@rchampourlier
rchampourlier / example_spec.rb
Created Aug 14, 2012 — forked from henrik/example_spec.rb
Testing Draper decorators with real helpers, including URL helpers.
View example_spec.rb
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 Jun 7, 2012 — forked from potomak/_flash.html.erb
Rails flash messages using Twitter bootstrap
View _flash.html.haml
- if flash
- flash.each do |level, message|
%div{:class => "alert #{flash_level(level)}"}
%button.close{:"data-dismiss" => 'alert'}= "×"
= message