Add strong params to tag_masters_controller
This commit is contained in:
parent
3941665c7e
commit
7199b9b189
1 changed files with 9 additions and 1 deletions
|
@ -18,7 +18,7 @@ module Nonprofits
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
json_saved CreateTagMaster.create(current_nonprofit, params[:tag_master])
|
json_saved(current_nonprofit.tag_masters.create(tag_master_params[:tag_master]))
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
|
@ -27,5 +27,13 @@ module Nonprofits
|
||||||
tag_master.tag_joins.destroy_all
|
tag_master.tag_joins.destroy_all
|
||||||
render json: {}, status: :ok
|
render json: {}, status: :ok
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def tag_master_params
|
||||||
|
params.require(:tag_master).permit(:name).tap do |tag_params|
|
||||||
|
tag_params.require(:name) # SAFER
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue