Sha256: f80439cdc59bc4aeb00837d002491589c1c26c2669c4ee1423d5c51d312b177e

Contents?: true

Size: 706 Bytes

Versions: 8

Compression:

Stored size: 706 Bytes

Contents

<h1>Custom Header and Footer</h1>

<%= will_filter_tag(@orders) %>
<%= will_filter_table_tag(@orders, 
	:columns => [:id, :user_id, [:amount, :filterable => true], :created_at],
	:header => {
		:label => "Total Amount",	
		:value => lambda{ |key|
			if (key == :amount) 
				total = @orders.wf_filter.sum(key)
				if total < 1000
					raw("<span style='color:red;'>#{number_to_currency(total)}</span>")
				else	
					raw("<span style='color:green;'>#{number_to_currency(total)}</span>")	
				end
			end	
		}
	},
	:footer => {
		:style => "background-color: #eee;",
		:value => {
			:id => "<strong>Range:</strong>".html_safe,
			:amount => [:range, {:style=>"color:blue; font-weight:bold;"}]
		}
	}	
) %>

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
will_filter-5.1.4 test/dummy/app/views/orders/index.html.erb
will_filter-5.1.3 test/dummy/app/views/orders/index.html.erb
will_filter-5.1.2 test/dummy/app/views/orders/index.html.erb
will_filter-5.1.1 test/dummy/app/views/orders/index.html.erb
will_filter-5.1.0 test/dummy/app/views/orders/index.html.erb
will_filter-3.1.11 test/dummy/app/views/orders/index.html.erb
will_filter-3.1.10 test/dummy/app/views/orders/index.html.erb
will_filter-3.1.9 test/dummy/app/views/orders/index.html.erb