Class: Oxen::PrintserversController

Inherits:
AbstractResourcesController
  • Object
show all
Defined in:
app/controllers/oxen/printservers_controller.rb

Instance Method Summary collapse

Instance Method Details

#portObject



4
5
6
7
8
9
10
11
12
13
14
15
# File 'app/controllers/oxen/printservers_controller.rb', line 4

def port
  authorize Printserver.new
  unless params[:mac].blank?
    port = Printserver.find_by_mac_addr(params[:mac])
    if !port
      port = 'port not found!'
    else
      port = port.active ? port.port : 'printserver er ikke aktiv!'
    end
    render plain: port
  end
end