Module: Faalis::Dashboard::Sections::ResourceShow

Extended by:
ActiveSupport::Concern
Included in:
DSL
Defined in:
lib/faalis/dashboard/sections/resource_show.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary (collapse)

Instance Method Details

- (Object) _show_fields (private)

@all_valid_columns_for_show = columns end



50
51
52
# File 'lib/faalis/dashboard/sections/resource_show.rb', line 50

def _show_fields
  all_valid_columns_for_show.keys.map(&:to_sym)
end

- (Object) collect_model_fields_for_show (protected)



25
26
27
28
# File 'lib/faalis/dashboard/sections/resource_show.rb', line 25

def collect_model_fields_for_show
  @_fields ||= show_properties.fields
  #valid_columns = all_valid_columns_for_show
end

- (Object) show

The actual action method of a dashboard controller



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/faalis/dashboard/sections/resource_show.rb', line 9

def show
  @resource = model.find(params[:id])
  authorize @resource

  collect_model_fields_for_show

  @resource_title = _resource_title.singularize

  show_hook(@resource)

  return if _override_views.include? :show
  render 'faalis/dashboard/resource/show'
end

- (Object) show_hook(resource) (private)

You can override this method to change the behaviour of show action



56
57
# File 'lib/faalis/dashboard/sections/resource_show.rb', line 56

def show_hook(resource)
end

- (Object) show_properties (protected)



30
31
32
# File 'lib/faalis/dashboard/sections/resource_show.rb', line 30

def show_properties
  Faalis::Dashboard::DSL::Show.new(model)
end