* 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
10 lines
310 B
Ruby
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
|