Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Create a test mountable rails engine and mount through a parent rails routes
mount RailsEngineTest::Engine => 'api/v3/'
module RailsEngineTest
class Engine < ::Rails::Engine
isolate_namespace RailsEngineTest
end
class FakeLocationsController < ActionController::Base
protect_from_forgery
def create
render text: 'hello create'
end
def index
render text: 'hello index'
end
end
Engine.routes.draw do
resources :fake_locations, only: %i[create index]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.