Skip to content

Commit

Permalink
label configuration form sceleton
Browse files Browse the repository at this point in the history
related: #20 , #12
  • Loading branch information
fwolfst committed Mar 6, 2020
1 parent bc6fb57 commit 9b7f3e7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/controllers/devices/label_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,8 @@ def set_device
device = Device.find params[:device_id]
@device = ConnectedDevice.new(device: device)
end

def label_configuration_params
params.fetch(:label_configuration, {}).permit(:port_orientation)
end
end
9 changes: 9 additions & 0 deletions app/views/devices/label/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@
-#
-# SPDX-License-Identifier: AGPL-3.0-or-later
= form_with model: @label_configuration, url: device_label_path(device_id: @device.id), builder: BulmaFormBuilder::HorizontalBulmaFormBuilder, method: :get do |form|
.field.is-horizontal
.field-label
= form.label :port_orientation, class: 'field-label'
.field-body
= form.select :port_orientation, ['left', 'right'], class: 'field-body'
= form.submit


%table.label-table
%thead
%tr.device_head
Expand Down

0 comments on commit 9b7f3e7

Please sign in to comment.