diff options
author | David Yip <yipdw@member.fsf.org> | 2017-10-15 04:51:42 -0500 |
---|---|---|
committer | David Yip <yipdw@member.fsf.org> | 2017-10-21 14:54:36 -0500 |
commit | 2e03a10059889cb05d4fab7736447a4315f90bf5 (patch) | |
tree | c5f4a997e9ed281ed356284f2c2450fb3a46d8bf /app/controllers | |
parent | 4fa2f7e82d68c974ecfdb8896f15a5a3aba25828 (diff) |
Spike out index and new views for keyword mutes controller.
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/settings/keyword_mutes_controller.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/app/controllers/settings/keyword_mutes_controller.rb b/app/controllers/settings/keyword_mutes_controller.rb index ffe94e33a..4b3e01b9c 100644 --- a/app/controllers/settings/keyword_mutes_controller.rb +++ b/app/controllers/settings/keyword_mutes_controller.rb @@ -4,4 +4,27 @@ class Settings::KeywordMutesController < ApplicationController layout 'admin' before_action :authenticate_user! + before_action :set_account + + def index + @keyword_mutes = paginated_keyword_mutes_for_account + end + + def new + @keyword_mute = keyword_mutes_for_account.build + end + + private + + def set_account + @account = current_user.account + end + + def keyword_mutes_for_account + KeywordMute.where(account: @account) + end + + def paginated_keyword_mutes_for_account + keyword_mutes_for_account.order(:keyword).page params[:page] + end end |