profile_helper.rb 520 Bytes
module ProfileHelper

  def display_field(title, object, field)
    value = object.send(field)
    if !value.blank?
      if block_given?
        value = yield(value)
      end
      content_tag('tr', content_tag('td', title, :class => 'field-name') + content_tag('td', value))
    else
      ''
    end
  end

  def pagination_links(collection, options={})
    options = {:prev_label => '« ' + _('Previous'), :next_label => _('Next') + ' »'}.merge(options)
    will_paginate(collection, options)
  end

end