Class: AdminAssistant::ShowView
- Inherits:
-
Object
- Object
- AdminAssistant::ShowView
- Defined in:
- lib/admin_assistant/show_view.rb
Instance Method Summary collapse
- #column_html(column) ⇒ Object
- #columns ⇒ Object
-
#initialize(record, admin_assistant, action_view) ⇒ ShowView
constructor
A new instance of ShowView.
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 |
#columns ⇒ Object
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 |