Class: ShipDashboard

Inherits:
Object
  • Object
show all
Defined in:
app/super/ship_dashboard.rb

Instance Method Summary collapse

Instance Method Details

#create_permitted_params(params) ⇒ Object



26
27
28
# File 'app/super/ship_dashboard.rb', line 26

def create_permitted_params(params)
  params.require(:ship).permit(:name, :registry, :class_name)
end

#create_scopeObject



22
23
24
# File 'app/super/ship_dashboard.rb', line 22

def create_scope
  Ship.all
end

#destroy_scopeObject



76
77
78
# File 'app/super/ship_dashboard.rb', line 76

def destroy_scope
  Ship.all
end

#edit_schemaObject



46
47
48
49
50
51
52
# File 'app/super/ship_dashboard.rb', line 46

def edit_schema
  Super::Schema.new(Super::Form::SchemaTypes.new) do |fields, type|
    fields[:name] = type.generic("form_generic_text")
    fields[:registry] = type.generic("form_generic_text")
    fields[:position] = type.generic("form_generic_text")
  end
end

#edit_scopeObject



42
43
44
# File 'app/super/ship_dashboard.rb', line 42

def edit_scope
  Ship.all
end

#index_schemaObject



14
15
16
17
18
19
20
# File 'app/super/ship_dashboard.rb', line 14

def index_schema
  Super::Schema.new(Super::Display::SchemaTypes.new) do |fields, type|
    fields[:name] = type.dynamic { |name| name }
    fields[:registry] = type.dynamic { |registry| registry }
    fields[:class_name] = type.dynamic { |class_name| class_name }
  end
end

#index_scopeObject



10
11
12
# File 'app/super/ship_dashboard.rb', line 10

def index_scope
  Ship.all
end

#modelObject



6
7
8
# File 'app/super/ship_dashboard.rb', line 6

def model
  Ship
end

#new_schemaObject



34
35
36
37
38
39
40
# File 'app/super/ship_dashboard.rb', line 34

def new_schema
  Super::Schema.new(Super::Form::SchemaTypes.new) do |fields, type|
    fields[:name] = type.generic("form_generic_text")
    fields[:registry] = type.generic("form_generic_text")
    fields[:position] = type.generic("form_generic_text")
  end
end

#new_scopeObject



30
31
32
# File 'app/super/ship_dashboard.rb', line 30

def new_scope
  Ship.all
end

#show_schemaObject



58
59
60
61
62
63
64
65
66
# File 'app/super/ship_dashboard.rb', line 58

def show_schema
  Super::Schema.new(Super::Display::SchemaTypes.new) do |fields, type|
    fields[:name] = type.dynamic { |name| name }
    fields[:registry] = type.dynamic { |registry| registry }
    fields[:class_name] = type.dynamic { |class_name| class_name }
    fields[:created_at] = type.dynamic(&:iso8601)
    fields[:updated_at] = type.dynamic(&:iso8601)
  end
end

#show_scopeObject



54
55
56
# File 'app/super/ship_dashboard.rb', line 54

def show_scope
  Ship.all
end

#titleObject



2
3
4
# File 'app/super/ship_dashboard.rb', line 2

def title
  Ship.name.pluralize
end

#update_permitted_params(params) ⇒ Object



72
73
74
# File 'app/super/ship_dashboard.rb', line 72

def update_permitted_params(params)
  params.require(:ship).permit(:name, :registry, :class_name)
end

#update_scopeObject



68
69
70
# File 'app/super/ship_dashboard.rb', line 68

def update_scope
  Ship.all
end