Module: AdminAssistant::Column::ShowViewMethods

Included in:
BelongsToColumn::ShowView, ShowView, PaperclipColumn::ShowView
Defined in:
lib/admin_assistant/column.rb

Instance Method Summary collapse

Instance Method Details

#html(record) ⇒ Object



306
307
308
309
310
311
312
313
314
315
316
317
318
319
# File 'lib/admin_assistant/column.rb', line 306

def html(record)
  slug = "_#{name}_for_show"
  if File.exist?(custom_template_file_path(slug))
    varname = @model_class.name.underscore
    @action_view.instance_variable_set("@#{varname}".to_sym, record)
    locals = {varname.to_sym => record}
    @action_view.render(
      :file => file_option_for_custom_template_render(slug),
      :locals => locals
    )
  else
    @action_view.send(:h, string(record))
  end
end