diff --git a/app/controllers/choice/application_controller.rb b/app/controllers/choice/application_controller.rb new file mode 100644 index 0000000..9930d2d --- /dev/null +++ b/app/controllers/choice/application_controller.rb @@ -0,0 +1,7 @@ +require_dependency 'discourse' + +module Choice + class ApplicationController < ActionController::Base + include CurrentUser + end +end diff --git a/app/controllers/choice/choice_controller.rb b/app/controllers/choice/choice_controller.rb new file mode 100644 index 0000000..c1846bd --- /dev/null +++ b/app/controllers/choice/choice_controller.rb @@ -0,0 +1,7 @@ +module Choice + class ChoiceController < Choice::ApplicationController + def about + head 200 + end + end +end diff --git a/app/helpers/choice/application_helper.rb b/app/helpers/choice/application_helper.rb new file mode 100644 index 0000000..3d7be32 --- /dev/null +++ b/app/helpers/choice/application_helper.rb @@ -0,0 +1,5 @@ + +module Choice + module ApplicationHelper + end +end diff --git a/config/routes.rb b/config/routes.rb new file mode 100644 index 0000000..6c9841a --- /dev/null +++ b/config/routes.rb @@ -0,0 +1,3 @@ +Choice::Engine.routes.draw do + get "about" => "choice#about" +end diff --git a/plugin.rb b/plugin.rb index 8f4c812..208b603 100644 --- a/plugin.rb +++ b/plugin.rb @@ -1,4 +1,17 @@ # name: choice-plugin # about: Integrating CHOICE with Discourse -# version: 0.0.1 +# version: 0.0.2 # authors: Rimian Perkins + +module ::Choice + class Engine < ::Rails::Engine + engine_name 'choice' + isolate_namespace Choice + end +end + +after_initialize do + Discourse::Application.routes.prepend do + mount ::Choice::Engine, at: '/choice' + end +end