Class: Faalis::Generators::DashboardScaffold

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
ActionView::Helpers::TextHelper, Concerns::AllowQueryOn, Concerns::Angular, Concerns::Bulk, Concerns::Child, Concerns::Dependency, Concerns::Fieldset, Concerns::InputFile, Concerns::Menu, Concerns::Model, Concerns::Parent, Concerns::Render, Concerns::RequireFields, Concerns::ResourceFields, Concerns::ResourceName, Concerns::Tabs, Concerns::Where
Defined in:
lib/faalis/generators/dashboard_scaffold.rb

Overview

DashboardScaffold is the base class for all the dashboard scaffolds which make creating scaffold generators way more easier. But you can drive your own generator normally of caurse

Instance Method Summary (collapse)

Methods included from Concerns::Fieldset

#fieldset?, #fieldset_less_fields, #fieldsets

Methods included from Concerns::Where

#where_cond?, #where_conditions

Methods included from Concerns::Render

#render

Methods included from Concerns::AllowQueryOn

#allowed_fields, #allowed_fields_provided?

Methods included from Concerns::Model

#model, #model_specified?

Methods included from Concerns::Tabs

#any_tabs?, #tab_has_field?, #tabs

Methods included from Concerns::Angular

#angularjs_app_path

Methods included from Concerns::Child

#child?, #childs

Methods included from Concerns::Parent

#parent?, #parents, #trim_parent_path

Methods included from Concerns::RequireFields

#required_fields

Methods included from Concerns::Bulk

#bulk_edit_fields, #no_bulk?

Methods included from Concerns::Dependency

#deps, #have_dependency?

Methods included from Concerns::Menu

#has_menu?

Methods included from Concerns::ResourceFields

#attrs, #fields, #fields?, #fields_as_params, #fields_hash, #fields_with, #fields_with_attribute, #grid_fields, #no_duplicate?, #no_filter?, #raw_fields_data

Methods included from Concerns::ResourceName

#resource, #resource_path, #resource_url

Methods included from Concerns::InputFile

#extname, #file_path, #input_file_data, #resource_data

Instance Method Details

- (Object) source_paths (private)

Overrided source_paths method. With this approach extensions can override generators templates. Cool ha ?



46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/faalis/generators/dashboard_scaffold.rb', line 46

def source_paths
  @source_paths = self.class.source_paths_for_search

  paths = []
  Faalis::Extension.extensions.each do |name, klass|
    if klass.respond_to? :generator_templates_path.to_sym
      paths << klass.generator_templates_path
    end
  end
  paths += @source_paths
  @source_paths = paths
end