Class: Monolith::RoutesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/monolith/routes_controller.rb

Defined Under Namespace

Classes: Index, Route, Show

Instance Method Summary collapse

Instance Method Details

#indexObject



4
5
6
# File 'app/controllers/monolith/routes_controller.rb', line 4

def index
  render Index.new.tap { _1.routes = Route.all }
end

#showObject



8
9
10
11
12
13
# File 'app/controllers/monolith/routes_controller.rb', line 8

def show
  route = Route.find(params[:id].to_s)
  return render plain: "Route not found", status: :not_found unless route

  render Show.new.tap { |v| v.route = route }
end