Sha256: a5211885eccac9b81f231e8f605245a1b05032eb825885fd51d7ef0cbf647944

Contents?: true

Size: 1.07 KB

Versions: 47

Compression:

Stored size: 1.07 KB

Contents

# -*- encoding : utf-8 -*-
# not needed here, since this is only used in the views InlineForms::SPECIAL_COLUMN_TYPES[:info]=:string

def pdf_link_show(object, attribute)
  # the attribute is the action
  "#{link_to 'preview', "/#{attribute}/#{object.id}", :class => "pdf_preview"} #{link_to 'pdf', "/#{attribute}/#{object.id}.pdf", :class => "pdf_open"}".html_safe
end

def pdf_link_edit(object, attribute)
  o = object.send(attribute)
  o = o.to_s + " (" + distance_of_time_in_words_to_now(o) + ")" if o.is_a?(Time)
  o = o._presentation if o.respond_to?(:_presentation)
  o
end

def pdf_link_update(object, attribute)
  # do absolutely nothing
end

#module ActionView::Helpers::DateHelper
#
#  def distance_of_time_in_words_to_now_with_future(from_time, include_seconds = false)
#    if from_time > Time.now()
#      'in ' + distance_of_time_in_words_to_now_without_future(from_time, include_seconds)
#    else
#      distance_of_time_in_words_to_now_without_future(from_time, include_seconds) + ' ago'
#    end
#  end
#
#  alias_method_chain :distance_of_time_in_words_to_now, :future
#
#end
#

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
inline_forms-6.2.14 app/helpers/form_elements/pdf_link.rb
inline_forms-6.2.12 app/helpers/form_elements/pdf_link.rb
inline_forms-6.2.11 app/helpers/form_elements/pdf_link.rb
inline_forms-6.2.10 app/helpers/form_elements/pdf_link.rb
inline_forms-6.2.9 app/helpers/form_elements/pdf_link.rb
inline_forms-6.2.7 app/helpers/form_elements/pdf_link.rb
inline_forms-6.2.6 app/helpers/form_elements/pdf_link.rb
inline_forms-6.2.5 app/helpers/form_elements/pdf_link.rb
inline_forms-6.2.4 app/helpers/form_elements/pdf_link.rb
inline_forms-6.2.3 app/helpers/form_elements/pdf_link.rb
inline_forms-6.2.2 app/helpers/form_elements/pdf_link.rb
inline_forms-6.2.1 app/helpers/form_elements/pdf_link.rb
inline_forms-6.1.1 app/helpers/form_elements/pdf_link.rb
inline_forms-6.1.0 app/helpers/form_elements/pdf_link.rb
inline_forms-6.0.8 app/helpers/form_elements/pdf_link.rb
inline_forms-6.0.7 app/helpers/form_elements/pdf_link.rb
inline_forms-6.0.6 app/helpers/form_elements/pdf_link.rb
inline_forms-6.0.5 app/helpers/form_elements/pdf_link.rb
inline_forms-6.0.4 app/helpers/form_elements/pdf_link.rb
inline_forms-6.0.3 app/helpers/form_elements/pdf_link.rb