Skip to content

Instantly share code, notes, and snippets.

Avatar

Josua Muheim jmuheim

View GitHub Profile
View _form.html.haml
/ ...
- f.inputs do
= f.hidden_field :lock_version
/ ...
@jmuheim
jmuheim / gist:3721506
Created Sep 14, 2012
Rails signatures ...
View gist:3721506
# Creates a Twitter Bootstrap nav item.
#
# @see http://twitter.github.com/bootstrap/components.html#navs
#
# @param [String optional] caption The caption of the item, optional if a block is passed
# @param [String optional] url The URL of the item
# @param [Hash] options
# @option options [Boolean] :brand (false) Set to true to define this item as the brand (this should be called directly on the `navbar` element itself as it also omits the surrounding `li` element)
# @option options [Boolean] :icon (nil) Pass the name of an icon (without the prefix `icon-`) to have an icon displayed to the left of the caption; see [available icons](http://twitter.github.com/bootstrap/base-css.html#icons)
# @return [String] HTML code
@jmuheim
jmuheim / gist:3436567
Created Aug 23, 2012
Tables with white-space:nowrap, overflow:hidden, text-overflow:ellipsis that do not need table-layout:fixed
View gist:3436567
<html>
<head>
<style type="text/css" media="screen">
table {
width: 100%;
table-layout: fixed;
border-collapse: collapse;
}
table th, table td {