mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-13 17:30:38 -07:00
working on recipient lists
This commit is contained in:
parent
37e01c024b
commit
645d7bc7d5
10 changed files with 49 additions and 17 deletions
|
|
@ -1,4 +1,5 @@
|
|||
class RecipientListsController < ApplicationController
|
||||
before_action :stringify_recipient_ids, only: [:create, :update]
|
||||
before_action :set_school
|
||||
before_action :set_recipient_list, only: [:show, :edit, :update, :destroy]
|
||||
|
||||
|
|
@ -57,6 +58,13 @@ class RecipientListsController < ApplicationController
|
|||
@recipient_list = @school.recipient_lists.find(params[:id])
|
||||
end
|
||||
|
||||
def stringify_recipient_ids
|
||||
ids = params[:recipient_list][:recipient_ids]
|
||||
if ids.present? && ids.is_a?(Array)
|
||||
params[:recipient_list][:recipient_ids] = ids.reject { |id| id.empty? }.join(',')
|
||||
end
|
||||
end
|
||||
|
||||
# Only allow a trusted parameter "white list" through.
|
||||
def recipient_list_params
|
||||
params.require(:recipient_list).permit(:name, :description, :recipient_ids)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
class WelcomeController < ApplicationController
|
||||
|
||||
def index
|
||||
@schools = School.all
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue