Module: PinboardItemsHelper

Defined in:
app/helpers/pinboard_items_helper.rb

Instance Method Summary (collapse)

Instance Method Details



3
4
5
6
7
8
9
# File 'app/helpers/pinboard_items_helper.rb', line 3

def pin_item_to_pinboard_link(object, user)
  if !object.pinned?(user)
    link_to((:span, 'Pin', class: 'pin-button'), pinboard_items_path(pinboard_item: {pinned_object_id: object.id, pinned_object_type: object.metamorphosize.class.name}), class: 'navigation-item' , method: :post)
  else
    (:span, 'Pinned', class: 'pin-button disable-button')
  end
end

- (Object) pinboard_item_options(pinboard_item)



11
12
13
14
15
16
17
18
19
20
# File 'app/helpers/pinboard_items_helper.rb', line 11

def pinboard_item_options(pinboard_item)
options = [
  link_to('Remove', pinboard_item_path(pinboard_item), class: [ :remove, 'circle-button', 'button-delete' ], method: :delete) 
]
options.push(source_document_viewer_option_tag(pinboard_item.pinned_object)) if pinboard_item.pinned_object.kind_of?(Source)

(:div, class: 'itemOptions') do
  options.compact.join.html_safe
end.html_safe
end