Class: Cms::FormEntriesController::FauxContentType

Inherits:
ContentType
  • Object
show all
Defined in:
app/controllers/cms/form_entries_controller.rb

Overview

Allows Entries to be displayed using same view as Content Blocks.

Constant Summary

Constants inherited from ContentType

ContentType::DEFAULT_CONTENT_TYPE_NAME

Instance Attribute Summary

Attributes inherited from ContentType

#name, #path_builder

Instance Method Summary collapse

Methods inherited from ContentType

addressable, available, available_by_module, connectable, #connectable?, #content_block_type, #content_block_type_for_list, create!, default, find_by_key, #form, list, #model_class, #module_name, named, #orderable_attributes, other_connectables, #param_key, #save!, user_generated_connectables

Constructor Details

#initialize(form) ⇒ FauxContentType

Returns a new instance of FauxContentType.



115
116
117
118
# File 'app/controllers/cms/form_entries_controller.rb', line 115

def initialize(form)
  @form = form
  self.name = 'Cms::FormEntry'
end

Instance Method Details

#columns_for_indexObject



127
128
129
130
131
132
# File 'app/controllers/cms/form_entries_controller.rb', line 127

def columns_for_index
  cols = @form.fields.collect do |field|
    {:label => field.label, :method => field.name}
  end
  cols
end

#display_nameObject



120
121
122
# File 'app/controllers/cms/form_entries_controller.rb', line 120

def display_name
  'Entry'
end

#display_name_pluralObject



124
125
126
# File 'app/controllers/cms/form_entries_controller.rb', line 124

def display_name_plural
  "Entries for #{@form.name} form"
end