Class: Admin::RobotPropertiesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Admin::RobotPropertiesController
- Defined in:
- app/controllers/admin/robot_properties_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #find_robot_by_id ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #print_labels ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
32 33 34 35 36 37 38 39 |
# File 'app/controllers/admin/robot_properties_controller.rb', line 32 def create @robot_property = @robot.robot_properties.build(params[:robot_property]) if @robot_property.save redirect_to [:admin, @robot, @robot_property] else render action: 'new' end end |
#destroy ⇒ Object
50 51 52 53 54 55 56 57 |
# File 'app/controllers/admin/robot_properties_controller.rb', line 50 def destroy @robot_property = RobotProperty.find(params[:id]) @robot_property.destroy respond_to do |format| format.html { redirect_to admin_robot_robot_properties_path(@robot) } format.xml { head :ok } end end |
#edit ⇒ Object
29 30 31 |
# File 'app/controllers/admin/robot_properties_controller.rb', line 29 def edit @robot_property = @robot.robot_properties.find(params[:id]) end |
#find_robot_by_id ⇒ Object
59 60 61 |
# File 'app/controllers/admin/robot_properties_controller.rb', line 59 def find_robot_by_id @robot = Robot.find(params[:robot_id]) end |
#index ⇒ Object
9 10 11 |
# File 'app/controllers/admin/robot_properties_controller.rb', line 9 def index @robot_properties = @robot.robot_properties end |
#new ⇒ Object
25 26 27 |
# File 'app/controllers/admin/robot_properties_controller.rb', line 25 def new @robot_property = @robot.robot_properties.build end |
#print_labels ⇒ Object
17 18 19 20 21 22 23 |
# File 'app/controllers/admin/robot_properties_controller.rb', line 17 def print_labels @robot_property = @robot.robot_properties.beds.find(params[:id]) if LabelPrinter::PrintJob.new(params[:printer], LabelPrinter::Label::RobotBeds, [@robot_property]).execute flash[:now] = 'The barcode for the bed was correctly printed' end redirect_to [:admin, @robot, @robot_property] end |
#show ⇒ Object
13 14 15 |
# File 'app/controllers/admin/robot_properties_controller.rb', line 13 def show @robot_property = @robot.robot_properties.find(params[:id]) end |
#update ⇒ Object
41 42 43 44 45 46 47 48 |
# File 'app/controllers/admin/robot_properties_controller.rb', line 41 def update @robot_property = RobotProperty.find(params[:id]) if @robot_property.update(params[:robot_property]) redirect_to [:admin, @robot, @robot_property] else render action: 'edit' end end |