| Command | Action |
|---|---|
| app.get "/route" | Test a get route |
| Model.all | Get array of model |
| Modal.first | Get first of model |
| Model.find(:id) | Find model by ID |
A popular Rails gem helper for creating declarative interfaces in controllers. Link here.
class ThingsController < ApplicationController # all the follpowing do the same way expose :thing, fetch: ->{ get_thing_some_way_or_another } expose(:thing){ get_thing_some_way_or_another } expose :thing, ->{ get_thing_some_way_or_another } expose :thing, :get_thing_some_way_or_another end