docbrown/app/controllers/article_mutes_controller.rb
Andy Zhao c4677071a7 Mute notifications for a comment thread (#1636)
* Use idempotent update instead of toggle

* Update editor guide with new comment instructions

* Render the settings button on page load

* Add settings button to comment dropdown

* Update styles to properly render

* Add comment mute function and settings page

* Clean up erb spacing

* Remove unneccessary user_id param

* Add receive_notifications for policy spec

* Update name for accuracy

* Add request spec for comments_mute

* Remove unused permitted attributes

* Add actually used permitted attributes
2019-01-24 17:20:38 -05:00

10 lines
310 B
Ruby

class ArticleMutesController < ApplicationController
after_action :verify_authorized
def update
@article = Article.find_by(id: params[:id])
authorize @article
@article.update(receive_notifications: permitted_attributes(@article)[:receive_notifications])
redirect_to "/dashboard"
end
end