Method: ActiveScaffold::Helpers::ListColumnHelpers#render_list_column

Defined in:
lib/active_scaffold/helpers/list_column_helpers.rb

#render_list_column(text, column, record) ⇒ Object

TODO: move empty_field_text and   logic in here? TODO: we need to distinguish between the automatic links we create and the ones that the dev specified. some logic may not apply if the dev specified the link.



53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/active_scaffold/helpers/list_column_helpers.rb', line 53

def render_list_column(text, column, record)
  if column.link && !skip_action_link?(column.link, record)
    link = column.link
    associated = record.send(column.association.name) if column.association
    authorized = link.action.nil?
    authorized, reason = column_link_authorized?(link, column, record, associated) unless authorized
    render_action_link(link, record, link: text, authorized: authorized, not_authorized_reason: reason)
  elsif inplace_edit?(record, column)
    active_scaffold_inplace_edit(record, column, formatted_column: text)
  elsif column_wrap_tag
     column_wrap_tag, text
  else
    text
  end
rescue StandardError => e
  message = "on the ActiveScaffold column = :#{column.name} in #{controller.class}"
  ActiveScaffold.log_exception(e, message)
  raise e.class, "#{e.message} -- #{message}", e.backtrace
end