Skip to content

Instantly share code, notes, and snippets.

=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 January 25, 2013 03:50
SimpleForm input that provides for example f.input :foo, :as => :time_picker
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
<%= javascript_include_tag "sifr", "sifr-config", :cache => true, :content_type => 'text/javascript' %>
in yaml
en:
activerecord:
errors:
models:
entry:
attributes:
day_name:
blank: "Please fill in the day name"
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