-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathplugin.rb
More file actions
18 lines (15 loc) · 715 Bytes
/
plugin.rb
File metadata and controls
18 lines (15 loc) · 715 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# name: solved_button
# about: add a button at the end of every post allowing users to mark a post as being correct
# author: shiv kumar
register_asset "javascripts/topic_cont.js"
register_asset "javascripts/topic_controller_cont2.js"
register_asset "javascripts/post_view_cont.js"
register_asset "stylesheets/correct_post.css.scss"
after_initialize do
load File.expand_path("../controllers/topics_controller.rb", __FILE__)
load File.expand_path("../models/topic.rb", __FILE__)
load File.expand_path("../serializers/topic_view_serializer.rb", __FILE__)
Discourse::Application.routes.prepend do
put "t/:slug/:topic_id/toggle_solved" => "topics#toggle_solved", constraints: {topic_id: /\d+/}
end
end