Skip to content

Instantly share code, notes, and snippets.

View gist:f7f6fa0a2c3cbac08fd7
NOKOGIRI_USE_SYSTEM_LIBRARIES=1 \
gem install nokogiri -- \
--with-xml2-config=/usr/local/opt/libxml2/bin/xml2-config \
--with-xslt-config=/usr/local/opt/libxslt/bin/xslt-config
View capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@sebastyuiop
sebastyuiop / TimePickerInput
Created Jan 25, 2013
SimpleForm input that provides for example f.input :foo, :as => :time_picker
View TimePickerInput
class TimePickerInput < SimpleForm::Inputs::Base
def input
js_node_id = input_html_options[:id] || "#{object_name}_#{attribute_name}"
template.content_tag :div, :class => 'input-append time' do
@builder.text_field(attribute_name, input_html_options.merge(:class => 'input-medium')) +
template.content_tag(:span, :class => 'add-on') do
template.content_tag :i, '', :class => 'icon-time'
end + js_code(js_node_id).html_safe
end
View gist:144385
<%= javascript_include_tag "sifr", "sifr-config", :cache => true, :content_type => 'text/javascript' %>
View gist:142277
in yaml
en:
activerecord:
errors:
models:
entry:
attributes:
day_name:
blank: "Please fill in the day name"