help_center 0.0.5 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -0
  3. data/CHANGELOG.md +34 -0
  4. data/LICENSE.txt +21 -21
  5. data/README.md +168 -164
  6. data/Rakefile +10 -10
  7. data/app/controllers/help_center/application_controller.rb +37 -37
  8. data/app/controllers/help_center/notifications_controller.rb +19 -19
  9. data/app/controllers/help_center/support_categories_controller.rb +54 -58
  10. data/app/controllers/help_center/support_posts_controller.rb +74 -72
  11. data/app/controllers/help_center/support_threads_controller.rb +84 -82
  12. data/app/helpers/help_center/support_posts_helper.rb +29 -29
  13. data/app/helpers/help_center/support_threads_helper.rb +28 -28
  14. data/app/jobs/help_center/support_post_notification_job.rb +42 -42
  15. data/app/jobs/help_center/support_thread_notification_job.rb +40 -40
  16. data/app/mailers/help_center/user_mailer.rb +28 -28
  17. data/app/models/support_category.rb +16 -13
  18. data/app/models/support_post.rb +15 -15
  19. data/app/models/support_subscription.rb +19 -19
  20. data/app/models/support_thread.rb +85 -85
  21. data/app/views/help_center/support_categories/_form.html.erb +39 -35
  22. data/app/views/help_center/support_categories/_support_thread.html.erb +25 -25
  23. data/app/views/help_center/support_categories/edit.html.erb +11 -7
  24. data/app/views/help_center/support_categories/index.html.erb +41 -16
  25. data/app/views/help_center/support_categories/new.html.erb +9 -5
  26. data/app/views/help_center/support_categories/show.html.erb +42 -20
  27. data/app/views/help_center/support_posts/_form.html.erb +47 -47
  28. data/app/views/help_center/support_posts/_support_post.html.erb +57 -57
  29. data/app/views/help_center/support_posts/edit.html.erb +23 -23
  30. data/app/views/help_center/support_threads/_form.html.erb +13 -12
  31. data/app/views/help_center/support_threads/_support_thread.html.erb +25 -25
  32. data/app/views/help_center/support_threads/edit.html.erb +11 -7
  33. data/app/views/help_center/support_threads/index.html.erb +0 -19
  34. data/app/views/help_center/support_threads/new.html.erb +7 -3
  35. data/app/views/help_center/support_threads/show.html.erb +11 -39
  36. data/app/views/help_center/user_mailer/new_post.html.erb +9 -9
  37. data/app/views/help_center/user_mailer/new_thread.html.erb +9 -9
  38. data/app/views/layouts/help_center.html.erb +49 -103
  39. data/app/views/shared/_category_actions.html.erb +16 -0
  40. data/app/views/shared/_sidebar.html.erb +66 -0
  41. data/app/views/shared/_spacer.html.erb +1 -1
  42. data/app/views/shared/_thread_actions.html.erb +16 -0
  43. data/bin/console +14 -14
  44. data/bin/setup +8 -8
  45. data/config/locales/en.yml +58 -55
  46. data/config/routes.rb +24 -24
  47. data/db/migrate/20170417012930_create_support_categories.rb +19 -19
  48. data/db/migrate/20170417012931_create_support_threads.rb +18 -18
  49. data/db/migrate/20170417012933_create_support_subscriptions.rb +11 -11
  50. data/help_center.gemspec +27 -29
  51. data/lib/generators/help_center/controllers_generator.rb +13 -13
  52. data/lib/generators/help_center/helpers_generator.rb +13 -13
  53. data/lib/generators/help_center/views_generator.rb +13 -13
  54. data/lib/help_center/engine.rb +10 -10
  55. data/lib/help_center/slack.rb +22 -22
  56. data/lib/help_center/support_user.rb +10 -10
  57. data/lib/help_center/version.rb +1 -1
  58. data/lib/help_center.rb +23 -23
  59. metadata +8 -20
  60. data/app/assets/stylesheets/help_center.scss +0 -139
  61. data/help_center-0.0.1.gem +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 544e4b74c59725cb067edbda4ef444d32219c13b2433ac277917e0bb5a6d5435
4
- data.tar.gz: b72851a4402159c203c7c91f682f7e9cefac1d4488997a82b72932ebb5f38502
3
+ metadata.gz: a00a78bdd79c176569db629519e3e35d23077ae1997b45220b4ea1a7299a0773
4
+ data.tar.gz: 3d26e2002c404e7584e53a9e2abff88e0ea6d7e586553fbc1d71432dcad3ea52
5
5
  SHA512:
6
- metadata.gz: 925ef4bccb5794eb48fa9b8c0decfe66c42b6467ab489b1d926a241b14dd6444623335c6e6faa1db3d489bc2a993940836648a272bbe04d9e0c1a065a78382e1
7
- data.tar.gz: 84c61d2bd086a3c489fd020895746139c1bace305768375b29ec010d1d8f9938881a3b001001776ca5bed23ae3418c3b2af76fa42c235132ffa233f607a4b3da
6
+ metadata.gz: 1f566db782b1e4aca5955226a1e05ae24fb6834a427251659b5011d9ee67675a7554cb6828c658a943f002797cc49c124cdcf8c7653765fe30e306397cecad25
7
+ data.tar.gz: 30604d9022de9695cf01e4878cf58142887fc959c66e13d8e9ef045630f47bca22a5c58247191d8be990af42fbe76e2523d22acaeed2cc709644dccec0718127
data/.gitignore CHANGED
@@ -8,3 +8,6 @@
8
8
  /spec/reports/
9
9
  /tmp/
10
10
  .DS_Store
11
+
12
+ # Ignore all files with the .gem extension
13
+ *.gem
data/CHANGELOG.md CHANGED
@@ -1 +1,35 @@
1
+ ### Unreleased
1
2
 
3
+ ### 0.0.7
4
+
5
+ * Improve default styling
6
+
7
+ ### 0.0.6
8
+
9
+ * Bug fixes
10
+ * Fix gemspec error
11
+ * Remove duplicate gem file
12
+ * Add changelog
13
+ * Add index page for categories
14
+ * Add descriptions to categories
15
+ * Change home page layout
16
+
17
+ ### 0.0.5
18
+
19
+ * [BREAKING] Remove Bootstrap in favor of TailwindCSS
20
+
21
+ ### 0.0.4
22
+
23
+ * Default CSS changes
24
+
25
+ ### 0.0.3
26
+
27
+ * Change article layout
28
+
29
+ ### 0.0.2
30
+
31
+ * Fix mailer errors
32
+
33
+ ### 0.0.1
34
+
35
+ * Initial release
data/LICENSE.txt CHANGED
@@ -1,21 +1,21 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2020 Ugurcan Kaya
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2021 Ugurcan Kaya
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md CHANGED
@@ -1,164 +1,168 @@
1
- # HelpCenter
2
-
3
- HelpCenter is a Rails wiki gem with Trix editor support for organizing app documentation and tutorials. It includes support categories, support articles, simple moderation, the ability to leave comments to support articles and more.
4
-
5
- Out of the box, HelpCenter comes with styling for Boostrap v4 but you're free to customize the UI as much as you like by installing the views and tweaking the HTML.
6
-
7
- ## Requirements
8
-
9
- ```
10
- Rails >= 6.0.0
11
- tailwindcss >= 1.6.0
12
- ```
13
-
14
- ## Installation
15
-
16
- Before you get started, HelpCenter requires a `User` model in your application (for now).
17
-
18
- Add this line to your application's Gemfile:
19
-
20
- ```ruby
21
- gem 'help_center'
22
- ```
23
-
24
- And then execute:
25
-
26
- ```bash
27
- bundle
28
- ```
29
-
30
- Install the migrations and migrate:
31
-
32
- ```bash
33
- rails help_center:install:migrations
34
- rails db:migrate
35
- ```
36
-
37
- Add HelpCenter to your `User` model. The model **must** have `name` method which will be used to display the user's name on comments & discussions (if enabled). Currently only a model named `User` will work.
38
-
39
- ```ruby
40
- class User < ActiveRecord::Base
41
- include HelpCenter::SupportUser
42
-
43
- def name
44
- "#{first_name} #{last_name}"
45
- end
46
- end
47
- ```
48
-
49
- Next add a `moderator` or `admin` flag to the `User` model.
50
-
51
- ```bash
52
- rails g migration AddModeratorToUsers moderator:boolean
53
- rails db:migrate
54
- ```
55
- Only moderators or admins can add support articles.
56
-
57
- ```
58
- if current_user.admin? || current_user.moderator?
59
- ```
60
-
61
- Add the following line to your `config/routes.rb` file:
62
-
63
- ```ruby
64
- mount HelpCenter::Engine => "/support"
65
- ```
66
-
67
- Add routes for active storage with your custom prefix
68
-
69
- ```ruby
70
- get "/support/rails/active_storage/blobs/:signed_id/*filename" =>
71
- "active_storage/blobs#show"
72
- get "/support/rails/active_storage/representations/:signed_blob_id/:variation_key/*filename" =>
73
- "active_storage/representations#show"
74
- ```
75
-
76
- Lastly, add the CSS to your `application.css` to load some default styles.
77
-
78
- ```scss
79
- *= require help_center
80
- ```
81
-
82
- ## Usage
83
-
84
- To get all the basic functionality, the only thing you need to do is add a link to HelpCenter in your navbar.
85
-
86
- ```erb
87
- <%= link_to "Docs", help_center_path %>
88
- ```
89
-
90
- This will take the user to the views inside the Rails engine and that's all you have to do!
91
-
92
- ### Customizing
93
-
94
- If you'd like to customize the views that HelpCenter uses, you can install the views to your Rails app:
95
-
96
- ```bash
97
- rails g help_center:views
98
- ```
99
-
100
- You can also install a copy of the HelpCenter controllers for advanced customization:
101
-
102
- ```bash
103
- rails g help_center:controllers
104
- ```
105
-
106
- Helpers are available for override as well. They are used for rendering the user avatars, text formatting, and more.
107
-
108
- ```bash
109
- rails g help_center:helpers
110
- ```
111
-
112
- **NOTE:** Keep in mind that the more customization you do, the tougher gem upgrades will be in the future.
113
-
114
- ### User comments & Notifications
115
-
116
- You can enable user comments and questions for support articles. HelpCenter will attempt to send email and slack notifications for users who leave comments when a new reply posted.
117
-
118
- To turn these off you can do the following in `config/initializers/help_center.rb`
119
-
120
- ```ruby
121
- HelpCenter.setup do |config|
122
- config.article_dicussions = false # Default: false
123
- config.send_email_notifications = false # Default: true
124
- config.send_slack_notifications = false # Default: true
125
- end
126
- ```
127
-
128
- Slack notifications require you to set `help_center_slack_url` in your `config/secrets.yml`. If you don't have this value set, it will not attempt Slack notifications even if they are enabled.
129
-
130
-
131
- ## Development
132
-
133
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
134
-
135
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
136
-
137
- ## Roadmap / Upcoming features
138
- Your support is appreciated for this project. Consider backing the project via GitHub Sponsors.
139
-
140
- We plan to release following features:
141
-
142
- - Contact form
143
- - Ticket submission
144
- - Live chat
145
- - Help Center Layout templates
146
- - Built-in search
147
-
148
- ## Acknowledgment
149
-
150
- HelpCenter generated from the awesome [simple_discussion](https://github.com/excid3/simple_discussion) gem by [Chris Oliver](https://github.com/excid3)
151
-
152
- HelpCenter uses [Trix editor](https://github.com/basecamp/trix) by [Basecamp](https://github.com/basecamp)
153
-
154
- ## Contributing
155
-
156
- Bug reports and pull requests are welcome on GitHub at https://github.com/uurcank/help_center This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
157
-
158
- ## License
159
-
160
- The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
161
-
162
- ## Code of Conduct
163
-
164
- Everyone interacting in the HelpCenter project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/pasilobus/help_center/blob/master/CODE_OF_CONDUCT.md).
1
+ # HelpCenter
2
+
3
+ ### 📖 Knowledge Base for your Ruby on Rails App
4
+
5
+ HelpCenter is a Rails wiki gem with Trix editor support for creating a knowledge base for your project. It includes support categories, support articles, simple moderation, the ability to leave comments to support articles and more.
6
+
7
+ Out of the box, HelpCenter comes with styling for TailwindCSS 2.0 but you're free to customize the UI as much as you like by installing the views and tweaking the HTML.
8
+
9
+ ## Requirements
10
+
11
+ ```
12
+ Rails >= 6.0.0
13
+ tailwindcss >= 2.0.0
14
+ ```
15
+
16
+ ## Installation
17
+
18
+ Before you get started, HelpCenter requires a `User` model in your application (for now).
19
+
20
+ Add this line to your application's Gemfile:
21
+
22
+ ```ruby
23
+ gem 'help_center'
24
+ ```
25
+
26
+ And then execute:
27
+
28
+ ```bash
29
+ bundle
30
+ ```
31
+
32
+ Install the migrations and migrate:
33
+
34
+ ```bash
35
+ rails help_center:install:migrations
36
+ rails db:migrate
37
+ ```
38
+
39
+ Add HelpCenter to your `User` model. The model **must** have `name` method which will be used to display the user's name on comments & discussions (if enabled). Currently only a model named `User` will work.
40
+
41
+ ```ruby
42
+ class User < ActiveRecord::Base
43
+ include HelpCenter::SupportUser
44
+
45
+ def name
46
+ "#{first_name} #{last_name}"
47
+ end
48
+ end
49
+ ```
50
+
51
+ Next add a `moderator` or `admin` flag to the `User` model.
52
+
53
+ ```bash
54
+ rails g migration AddModeratorToUsers moderator:boolean
55
+ rails db:migrate
56
+ ```
57
+ Only moderators or admins can add support articles.
58
+
59
+ ```
60
+ if current_user.admin? || current_user.moderator?
61
+ ```
62
+
63
+ Add the following line to your `config/routes.rb` file:
64
+
65
+ ```ruby
66
+ mount HelpCenter::Engine => "/docs"
67
+ ```
68
+
69
+ Add routes for active storage with your custom prefix
70
+
71
+ ```ruby
72
+ get "/support/rails/active_storage/blobs/:signed_id/*filename" =>
73
+ "active_storage/blobs#show"
74
+ get "/support/rails/active_storage/representations/:signed_blob_id/:variation_key/*filename" =>
75
+ "active_storage/representations#show"
76
+ ```
77
+
78
+ Lastly, add the CSS to your `application.css` to load some default styles.
79
+
80
+ ```scss
81
+ *= require help_center
82
+ ```
83
+
84
+ ## Usage
85
+
86
+ To get all the basic functionality, the only thing you need to do is add a link to HelpCenter in your navbar.
87
+
88
+ ```erb
89
+ <%= link_to "Docs", help_center_path %>
90
+ ```
91
+
92
+ This will take the user to the views inside the Rails engine and that's all you have to do!
93
+
94
+ ### Customizing
95
+
96
+ If you'd like to customize the views that HelpCenter uses, you can install the views to your Rails app:
97
+
98
+ ```bash
99
+ rails g help_center:views
100
+ ```
101
+
102
+ You can also install a copy of the HelpCenter controllers for advanced customization:
103
+
104
+ ```bash
105
+ rails g help_center:controllers
106
+ ```
107
+
108
+ Helpers are available for override as well. They are used for rendering the user avatars, text formatting, and more.
109
+
110
+ ```bash
111
+ rails g help_center:helpers
112
+ ```
113
+
114
+ **NOTE:** Keep in mind that the more customization you do, the tougher gem upgrades will be in the future.
115
+
116
+ ### User comments & Notifications
117
+
118
+ You can enable user comments and questions for support articles. HelpCenter will attempt to send email and slack notifications for users who leave comments when a new reply posted.
119
+
120
+ To turn these off you can do the following in `config/initializers/help_center.rb`
121
+
122
+ ```ruby
123
+ HelpCenter.setup do |config|
124
+ config.article_dicussions = false # Default: false
125
+ config.send_email_notifications = false # Default: true
126
+ config.send_slack_notifications = false # Default: true
127
+ end
128
+ ```
129
+
130
+ Slack notifications require you to set `help_center_slack_url` in your `config/secrets.yml`. If you don't have this value set, it will not attempt Slack notifications even if they are enabled.
131
+
132
+
133
+ ## Development
134
+
135
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
136
+
137
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
138
+
139
+ ## Roadmap / Upcoming features
140
+ Your support is appreciated for this project. Consider backing the project via GitHub Sponsors.
141
+
142
+ We plan to release following features:
143
+
144
+ - Contact form
145
+ - Built-in search
146
+ - Versioning Support
147
+ - Themes
148
+ - Dark Mode Support
149
+
150
+ ## Acknowledgment
151
+
152
+ [simple_discussion](https://github.com/excid3/simple_discussion) by [Chris Oliver](https://github.com/excid3)
153
+
154
+ [Trix editor](https://github.com/basecamp/trix) by [Basecamp](https://github.com/basecamp)
155
+
156
+ [TailwindCSS](https://github.com/basecamp/trix) by [Tailwind Labs](https://github.com/tailwindlabs/tailwindcss)
157
+
158
+ ## Contributing
159
+
160
+ Bug reports and pull requests are welcome on GitHub at https://github.com/uurcank/help_center This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
161
+
162
+ ## License
163
+
164
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
165
+
166
+ ## Code of Conduct
167
+
168
+ Everyone interacting in the HelpCenter project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/pasilobus/help_center/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile CHANGED
@@ -1,10 +1,10 @@
1
- require "bundler/gem_tasks"
2
- require "rake/testtask"
3
-
4
- Rake::TestTask.new(:test) do |t|
5
- t.libs << "test"
6
- t.libs << "lib"
7
- t.test_files = FileList["test/**/*_test.rb"]
8
- end
9
-
10
- task :default => :test
1
+ require "bundler/gem_tasks"
2
+ require "rake/testtask"
3
+
4
+ Rake::TestTask.new(:test) do |t|
5
+ t.libs << "test"
6
+ t.libs << "lib"
7
+ t.test_files = FileList["test/**/*_test.rb"]
8
+ end
9
+
10
+ task :default => :test
@@ -1,37 +1,37 @@
1
- class HelpCenter::ApplicationController < ::ApplicationController
2
- layout "help_center"
3
-
4
- def page_number
5
- page = params.fetch(:page, '').gsub(/[^0-9]/, '').to_i
6
- page = "1" if page.zero?
7
- page
8
- end
9
-
10
- def is_moderator_or_owner?(object)
11
- is_moderator?
12
- end
13
- helper_method :is_moderator_or_owner?
14
-
15
- def is_moderator?
16
- current_user.respond_to?(:moderator) && current_user.moderator? || current_user.respond_to?(:admin) && current_user.admin?
17
- end
18
- helper_method :is_moderator?
19
-
20
- def require_mod_or_author_for_post!
21
- unless is_moderator_or_owner?(@support_post)
22
- redirect_to_root
23
- end
24
- end
25
-
26
- def require_mod_or_author_for_thread!
27
- unless is_moderator_or_owner?(@support_thread)
28
- redirect_to_root
29
- end
30
- end
31
-
32
- private
33
-
34
- def redirect_to_root
35
- redirect_to help_center.root_path
36
- end
37
- end
1
+ class HelpCenter::ApplicationController < ::ApplicationController
2
+ layout "help_center"
3
+
4
+ def page_number
5
+ page = params.fetch(:page, '').gsub(/[^0-9]/, '').to_i
6
+ page = "1" if page.zero?
7
+ page
8
+ end
9
+
10
+ def is_moderator_or_owner?(object)
11
+ is_moderator?
12
+ end
13
+ helper_method :is_moderator_or_owner?
14
+
15
+ def is_moderator?
16
+ current_user.respond_to?(:moderator) && current_user.moderator? || current_user.respond_to?(:admin) && current_user.admin?
17
+ end
18
+ helper_method :is_moderator?
19
+
20
+ def require_mod_or_author_for_post!
21
+ unless is_moderator_or_owner?(@support_post)
22
+ redirect_to_root
23
+ end
24
+ end
25
+
26
+ def require_mod_or_author_for_thread!
27
+ unless is_moderator_or_owner?(@support_thread)
28
+ redirect_to_root
29
+ end
30
+ end
31
+
32
+ private
33
+
34
+ def redirect_to_root
35
+ redirect_to help_center.root_path
36
+ end
37
+ end
@@ -1,19 +1,19 @@
1
- class HelpCenter::NotificationsController < HelpCenter::ApplicationController
2
- before_action :authenticate_user!
3
- before_action :set_support_thread
4
-
5
- def create
6
- @support_thread.toggle_subscription(current_user)
7
- redirect_to help_center.support_thread_path(@support_thread)
8
- end
9
-
10
- def show
11
- redirect_to help_center.support_thread_path(@support_thread)
12
- end
13
-
14
- private
15
-
16
- def set_support_thread
17
- @support_thread = SupportThread.friendly.find(params[:support_thread_id])
18
- end
19
- end
1
+ class HelpCenter::NotificationsController < HelpCenter::ApplicationController
2
+ before_action :authenticate_user!
3
+ before_action :set_support_thread
4
+
5
+ def create
6
+ @support_thread.toggle_subscription(current_user)
7
+ redirect_to help_center.support_thread_path(@support_thread)
8
+ end
9
+
10
+ def show
11
+ redirect_to help_center.support_thread_path(@support_thread)
12
+ end
13
+
14
+ private
15
+
16
+ def set_support_thread
17
+ @support_thread = SupportThread.friendly.find(params[:support_thread_id])
18
+ end
19
+ end