This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
= semantic_form_for @pet do |form| | |
= form.inputs do | |
= form.input :animal | |
= form.input :diseases, :as => :check_boxes, :value_as_class => true | |
= form.buttons |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
= semantic_form_for @user_profile, :url => user_user_profile_path(@user), :html => {:multipart => true} do |form| | |
%p.large Personal information | |
%hr.profile | |
%p.smlTitle Phone Number | |
= form.inputs do | |
= form.semantic_fields_for :profile_phones do |phone| | |
= render 'profile_phone_fields', :form => phone | |
= link_to_add_fields "Add Phone", form, :profile_phones, "addPhone" | |
= form.buttons |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Main navigation elements. | |
-------------------------------------------------------------- */ | |
#Nav {height:45px;background:transparent} | |
#Nav ul {list-style:none;margin:10px 0 0 7px} | |
#Nav ul li {display:inline} | |
#Nav ul li a {list-style-type:none;display:inline-block;padding:10px 20px;color:#a1a1a1;background:#f4f4f4;border:1px solid #d1d1d1;text-transform:uppercase;-moz-border-radius:4px;-webkit-border-radius:4px;-moz-box-shadow:0 1px 3px #f1f1f1;-webkit-box-shadow:0 1px 3px #f1f1f1} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This is a pretty crappy brief to tout the benefits of "good CSS", "good SASS", | |
"good OOCSS" or anything else, but let's roll with it for now. | |
*/ | |
#Nav {height:45px;background:transparent} | |
#Nav ul {list-style:none;margin:10px 0 0 7px} | |
#Nav ul li {display:inline} | |
#Nav ul li a {list-style-type:none;display:inline-block;padding:10px 20px;color:#a1a1a1;background:#f4f4f4;border:1px solid #d1d1d1;text-transform:uppercase;-moz-border-radius:4px;-webkit-border-radius:4px;-moz-box-shadow:0 1px 3px #f1f1f1;-webkit-box-shadow:0 1px 3px #f1f1f1} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Let's say you've programatically built up an array of classes for a HTML element: | |
my_classes = [:a, :b, 'c'] | |
# Don't do this, join(" ") is for chumps: | |
<% content_tag(:p, "Foo", :class => my_classes.join(" ")) %> | |
# Winners do this: | |
<% content_tag(:p, "Foo", :class => my_classes) %> | |
# => <p class="a b c">Foo</p> | |
<% link_to("Foo", foos_path, :class => my_classes) %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This has very little win: | |
<%= content_tag(:p, "Foo", "data-bah" => "...", "data-baz" => "...") %> | |
# Some chumps make it even more noisy: | |
<%= content_tag(:p, "Foo", :"data-bah" => "...", :"data-baz" => "...") %> | |
# I was going to patch Rails to convert :data_bah to "data-bah" | |
<%= content_tag(:p, "Foo", :data_bah => "...", :data_baz => "...") %> | |
# But they already do this: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file contains custom input method from formtastic 1.2 and their | |
# replacement classes in 2.0 | |
module FormtasticExtensions | |
class WysiwygInput < Formtastic::Inputs::TextInput | |
def input_html_options | |
wysiwyg_type = input_options.delete(:controls) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
current-branch = !git branch | grep '^*' | sed s/\\*\\ // | |
track = !git branch --set-upstream $(git current-branch) origin/$(git current-branch) | |
publish = !git push origin $(git current-branch) && echo $(git track) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# PRODUCT MODEL | |
has_many :product_people | |
has_many :people, :through => :product_people | |
accepts_nested_attributes_for :people | |
<%= f.inputs "Cast" do %> | |
<%= f.inputs :for => :people do |p| %> | |
<%= p.input :name %> | |
<%= p.input :_destroy, :as => :boolean %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.something { | |
rules for older browsers like IE6–8 | |
} | |
.something:not(.crappy) { | |
extra rules for any browser that supports :not selector | |
the .crappy class is a hack, but it feels appropriate | |
} |