Class: Freegeoip::LookupsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/freegeoip/lookups_controller.rb

Instance Method Summary collapse

Instance Method Details

#showObject



5
6
7
8
9
10
11
# File 'app/controllers/freegeoip/lookups_controller.rb', line 5

def show
  if result = Freegeoip::Lookup.hostname_or_ip(params[:hostname_or_ip])
    render json: result
  else
    render body: "404 page not found", status: 404
  end
end