Class: AdminAssistant::ShowView

Inherits:
Object
  • Object
show all
Defined in:
lib/admin_assistant/show_view.rb

Instance Method Summary collapse

Constructor Details

#initialize(record, admin_assistant, action_view) ⇒ ShowView

Returns a new instance of ShowView.



3
4
5
6
# File 'lib/admin_assistant/show_view.rb', line 3

def initialize(record, admin_assistant, action_view)
  @record, @admin_assistant, @action_view =
      record, admin_assistant, action_view
end

Instance Method Details

#column_html(column) ⇒ Object



8
9
10
# File 'lib/admin_assistant/show_view.rb', line 8

def column_html(column)
  column.html @record
end

#columnsObject



12
13
14
15
16
17
18
# File 'lib/admin_assistant/show_view.rb', line 12

def columns
  column_names = @admin_assistant.show_settings.column_names || 
                 @admin_assistant.model_class.columns.map(&:name)
  @admin_assistant.accumulate_columns(column_names).map { |c|
    c.show_view @action_view, @admin_assistant
  }
end