Class: Monolith::ModelsController

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

Defined Under Namespace

Classes: Index, Model, Show

Instance Method Summary collapse

Instance Method Details

#indexObject



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

def index
  render Index.new.tap { _1.models = Model.all }
end

#showObject



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

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

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