app/helpers/workbench/navigation_helper.rb
# Used in show/REST
# A previous record link.
Used in show/REST
A previous record link.
Used in show / REST A previous record link .
def previous_link(instance, text: 'Previous', target: nil)
    link_text = content_tag(:span, text,  'data-icon' => 'arrow-left', 'class' => 'small-icon')
    link_object = instance.previous
    return content_tag(:div, link_text, 'class' => 'navigation-item disable') if link_object.nil?
    if target.nil?
      target ||= link_object.metamorphosize
    else
      target = send(target, id: link_object.id)
    end
    link_to(link_text, target, 'data-arrow' => 'back', 'class' => 'navigation-item')
  end
def previous_link ( instance , text : 'Previous' , target : nil ) link_text = content_tag ( :span , text , 'data-icon' => 'arrow-left' , 'class' => 'small-icon' ) link_object = instance . previous return content_tag ( :div , link_text , 'class' => 'navigation-item disable' ) if link_object . nil? if target . nil? target ||= link_object . metamorphosize else target = send ( target , id : link_object . id ) end link_to ( link_text , target , 'data-arrow' => 'back' , 'class' => 'navigation-item' ) end
Used in show/REST
A previous record link.
Used in show / REST A previous record link .
instance
<not_specific>
text
<not_specific>
target
<not_specific>