DEV Community

loading...

Rack application as a stub

vasily profile image Vasily Polovnyov ・1 min read

Sometimes you need to put a stub on a particular route, but do not want to make a controller for this. In this case use Rack application as a stub:

# config/routes.rb
get "wp-login", to: -> (env) { [200, {}, [""]] }
Enter fullscreen mode Exit fullscreen mode

Discussion (0)

pic
Editor guide