Flowdock

Notes posted by kwerle

RSS feed
December 30, 2016
0 thanks

Used within collection_check_boxes

Note the checked: option.

%table
  = collection_check_boxes(:ahj_types, :ids, AhjType.order(:TypeName), :AHJTypeID, :TypeName) do |b|
    %tr
      %td{style: 'padding: 0 1em;'}
        = b.label(class: "check_box")
      %td{style: 'padding: 0 1em;'}
        = b.check_box(class: "check_box", checked: (params[:ahj_types][:ids].member?(b.value.to_s)))
November 14, 2014
3 thanks

Opposite of persisted?

So I can find it when I look next time.

November 14, 2014
1 thank

Opposite of #new_record?

So that next time I look I find it.

June 19, 2013 - (>= v3.2.13)
1 thank

Must use :class, not 'class'

Note that

<%= content_tag_for(:li, @person, :class => “bar”) %>

does the right thing.

<%= content_tag_for(:li, @person, ‘class’ => “bar”) %>

will not!

May 18, 2012
0 thanks

Beware nested with_options clobbers!

Careful:

with_options :foo => :bar do |something|
  something.with_options :foo => :baz do |inner|
    what_is(:foo)
  end
end

:foo will be :baz. It will not be [:bar, :baz], for example.

This bit me when trying to do nested with_options for validation where both had :if => something.

December 10, 2008
0 thanks

Example

my_instance.connection.clear_query_cache