generated from discourse/discourse-plugin-skeleton
-
Notifications
You must be signed in to change notification settings - Fork 0
/
plugin.rb
36 lines (27 loc) · 1.03 KB
/
plugin.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# coding: utf-8
# frozen_string_literal: true
# name:discourse-contact-plugin
# about: Add a contact form
# meta_topic_id: 305462
# version: 0.2.0
# authors: Jon Ericson
# url: https://github.com/jericson/discourse-contact-plugin
# required_version: 2.7.0
enabled_site_setting :contact_form_enabled
register_asset "stylesheets/contact.scss"
module ::MyPluginModule
PLUGIN_NAME = "discourse-contact-plugin"
end
require_relative "lib/contact/engine"
require_relative File.expand_path("../lib/contact/contact_store.rb", __FILE__)
after_initialize do
require_relative File.expand_path("../app/controllers/contact_controller.rb", __FILE__)
require_relative File.expand_path("../app/controllers/contacts_controller.rb", __FILE__)
Discourse::Application.routes.append do
# Map the path `/contact` to `ContactController`’s `index` method
get "/contact" => "contact#index"
get "/contacts" => "contacts#index"
put "/contacts/:contact_id" => "contacts#create"
delete "/contacts/:contact_id" => "contacts#destroy"
end
end