Class: ShipDashboard
- Inherits:
-
Object
- Object
- ShipDashboard
- Defined in:
- app/super/ship_dashboard.rb
Instance Method Summary collapse
- #create_permitted_params(params) ⇒ Object
- #create_scope ⇒ Object
- #destroy_scope ⇒ Object
- #edit_schema ⇒ Object
- #edit_scope ⇒ Object
- #index_schema ⇒ Object
- #index_scope ⇒ Object
- #model ⇒ Object
- #new_schema ⇒ Object
- #new_scope ⇒ Object
- #show_schema ⇒ Object
- #show_scope ⇒ Object
- #title ⇒ Object
- #update_permitted_params(params) ⇒ Object
- #update_scope ⇒ Object
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_scope ⇒ Object
22 23 24 |
# File 'app/super/ship_dashboard.rb', line 22 def create_scope Ship.all end |
#destroy_scope ⇒ Object
76 77 78 |
# File 'app/super/ship_dashboard.rb', line 76 def destroy_scope Ship.all end |
#edit_schema ⇒ Object
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_scope ⇒ Object
42 43 44 |
# File 'app/super/ship_dashboard.rb', line 42 def edit_scope Ship.all end |
#index_schema ⇒ Object
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_scope ⇒ Object
10 11 12 |
# File 'app/super/ship_dashboard.rb', line 10 def index_scope Ship.all end |
#model ⇒ Object
6 7 8 |
# File 'app/super/ship_dashboard.rb', line 6 def model Ship end |
#new_schema ⇒ Object
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_scope ⇒ Object
30 31 32 |
# File 'app/super/ship_dashboard.rb', line 30 def new_scope Ship.all end |
#show_schema ⇒ Object
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_scope ⇒ Object
54 55 56 |
# File 'app/super/ship_dashboard.rb', line 54 def show_scope Ship.all end |
#title ⇒ Object
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_scope ⇒ Object
68 69 70 |
# File 'app/super/ship_dashboard.rb', line 68 def update_scope Ship.all end |