DEV: Add rails engine and file paths to skeleton (#29)
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module ::MyPluginModule
|
||||
class ExamplesController < ::ApplicationController
|
||||
requires_plugin PLUGIN_NAME
|
||||
|
||||
def index
|
||||
render json: { hello: "world" }
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,8 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
MyPluginModule::Engine.routes.draw do
|
||||
get "/examples" => "examples#index"
|
||||
# define routes here
|
||||
end
|
||||
|
||||
Discourse::Application.routes.draw { mount ::MyPluginModule::Engine, at: "my-plugin" }
|
||||
@@ -0,0 +1,9 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module ::MyPluginModule
|
||||
class Engine < ::Rails::Engine
|
||||
engine_name PLUGIN_NAME
|
||||
isolate_namespace MyPluginModule
|
||||
config.autoload_paths << File.join(config.root, "lib")
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user