mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-18 06:01:12 +00:00
Introduce strong parameters
This commit is contained in:
parent
38bc2e3c3a
commit
355ecc0ac6
93 changed files with 172 additions and 241 deletions
|
|
@ -9,7 +9,7 @@ module Admin
|
|||
end
|
||||
|
||||
def create
|
||||
@campaign.attributes = params[:campaign]
|
||||
@campaign.attributes = campaign_params
|
||||
|
||||
if @conference.save
|
||||
flash[:notice] = 'Campaign successfully created.'
|
||||
|
|
@ -25,7 +25,7 @@ module Admin
|
|||
def edit; end
|
||||
|
||||
def update
|
||||
if @campaign.update_attributes(params[:campaign])
|
||||
if @campaign.update_attributes(campaign_params)
|
||||
flash[:notice] = "Campaign '#{@campaign.name}' successfully updated."
|
||||
redirect_to(admin_conference_campaigns_path(conference_id: @conference.short_title))
|
||||
else
|
||||
|
|
@ -44,5 +44,11 @@ module Admin
|
|||
redirect_to(admin_conference_campaigns_path(conference_id: @conference.short_title))
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def campaign_params
|
||||
params.require(:campaign).permit(:name, :utm_source, :utm_medium, :utm_term, :utm_content, :utm_campaign, :target_ids, :conference_id)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue