Module: ViewMapper::HasManyView

Includes:
HasManyChildModels
Defined in:
lib/view_mapper/views/has_many/has_many_view.rb

Instance Attribute Summary

Attributes included from HasManyChildModels

#child_models

Class Method Summary collapse

Instance Method Summary collapse

Methods included from HasManyChildModels

#add_child_model_actions, #add_child_model_forms, #add_child_models_manifest, #find_child_models, #is_child_model_action?, #is_model_dependency_action, #is_view_show, #validate_child_model, #validate_child_model_associations, #validate_child_models

Class Method Details

.source_rootObject



6
7
8
# File 'lib/view_mapper/views/has_many/has_many_view.rb', line 6

def self.source_root
  File.expand_path(File.dirname(__FILE__) + "/templates")
end

Instance Method Details

#manifestObject



14
15
16
17
18
19
20
# File 'lib/view_mapper/views/has_many/has_many_view.rb', line 14

def manifest
  m = super.edit do |action|
    action unless is_child_model_action?(action)
  end
  add_child_models_manifest(m)
  m
end

#source_roots_for_viewObject



10
11
12
# File 'lib/view_mapper/views/has_many/has_many_view.rb', line 10

def source_roots_for_view
  [ HasManyView.source_root, File.expand_path(source_root), File.join(self.class.lookup('model').path, 'templates') ]
end

#validateObject



22
23
24
25
# File 'lib/view_mapper/views/has_many/has_many_view.rb', line 22

def validate
  super
  @valid &&= validate_child_models
end