Method: AdminAssistant::Column::IndexViewMethods#html

Defined in:
lib/admin_assistant/column.rb

#html(record) ⇒ Object



123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# File 'lib/admin_assistant/column.rb', line 123

def html(record)
  html_for_index_method = "#{name}_html_for_index"
  html = if @action_view.respond_to?(html_for_index_method)
    @action_view.send html_for_index_method, record
  elsif @link_to_args
    @action_view.link_to(
      @action_view.send(:h, string(record)),
      @link_to_args.call(record)
    )
  else
    unconfigured_html(record)
  end
  html = ' ' if html.blank?
  html
end