lib/tabulatr/tabulatr/header_cell.rb in tabulatr-0.2.0 vs lib/tabulatr/tabulatr/header_cell.rb in tabulatr-0.3.0
- old
+ new
@@ -35,28 +35,25 @@
raise "Not in header mode!" if @row_mode != :header
sortparam = "#{@classname}#{@table_form_options[:sort_postfix]}"
bid = "#{@classname}#{@table_form_options[:sort_postfix]}"
opts = normalize_column_options opts
make_tag(:th, opts[:th_html]) do
- concat(t(opts[:header] || name.to_s.humanize.titlecase), :escape_html)
+ concat(t(opts[:header] || @klaz.human_attribute_name(name).titlecase), :escape_html)
if opts[:sortable] and @table_options[:sortable]
if @sorting and @sorting[:by].to_s == name.to_s
pname = "#{sortparam}[_resort][#{name}][#{@sorting[:direction] == 'asc' ? 'desc' : 'asc'}]"
bid = "#{bid}_#{name}_#{@sorting[:direction] == 'asc' ? 'desc' : 'asc'}"
- psrc = File.join(@table_options[:image_path_prefix], @table_options[@sorting[:direction] == 'desc' ?
- :sort_down_button : :sort_up_button])
+ psrc = @table_options[@sorting[:direction] == 'desc' ?
+ :sort_down_button : :sort_up_button]
make_tag(:input, :type => :hidden,
:name => "#{sortparam}[#{name}][#{@sorting[:direction]}]",
:value => "#{@sorting[:direction]}")
else
pname = "#{sortparam}[_resort][#{name}][desc]"
bid = "#{bid}_#{name}_desc"
- psrc = File.join(@table_options[:image_path_prefix], @table_options[:sort_down_button_inactive])
+ psrc = @table_options[:sort_down_button_inactive]
end
- make_tag(:input, :type => 'image',
- :id => bid,
- :src => psrc,
- :name => pname)
+ make_image_button(psrc, :id => bid, :name => pname)
end
end # </th>
end
# the method used to actually define the headers of the columns,