Module: ObservationMatrixRowItemsHelper

Defined in:
app/helpers/observation_matrix_row_items_helper.rb

Instance Method Summary (collapse)

Instance Method Details



13
14
15
16
# File 'app/helpers/observation_matrix_row_items_helper.rb', line 13

def observation_matrix_row_item_link(observation_matrix_row_item)
  return nil if observation_matrix_row_item.nil?
  link_to(observation_matrix_row_item_tag(observation_matrix_row_item).html_safe, observation_matrix_row_item)
end

- (Object) observation_matrix_row_item_tag(observation_matrix_row_item)

!! when dynamic rows are extended this will have to reflect other types than tags



4
5
6
7
8
9
10
11
# File 'app/helpers/observation_matrix_row_items_helper.rb', line 4

def observation_matrix_row_item_tag(observation_matrix_row_item)
  return nil if observation_matrix_row_item.nil?
  if observation_matrix_row_item.is_dynamic?
    (controlled_vocabulary_term_tag(observation_matrix_row_item.controlled_vocabulary_term) + ' (tag keyword)').html_safe
  else
    (object_tag(observation_matrix_row_item.matrix_row_item_object) + " (single #{observation_matrix_row_item.matrix_row_item_object.class})").html_safe
  end 
end