mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-04 08:18:50 +01:00
move to strong_parameters of rails4.
This commit is contained in:
parent
049296fd33
commit
671f64b419
24 changed files with 153 additions and 61 deletions
|
|
@ -173,7 +173,7 @@ class ProjectsController < ApplicationController
|
|||
render_failure "Expected post format is valid xml like so: <project><name>project name</name></project>.", 400
|
||||
return
|
||||
end
|
||||
@project = current_user.projects.build(params['project'])
|
||||
@project = current_user.projects.build(project_params)
|
||||
@go_to_project = params['go_to_project']
|
||||
@saved = @project.save
|
||||
@project_not_done_counts = { @project.id => 0 }
|
||||
|
|
@ -212,7 +212,7 @@ class ProjectsController < ApplicationController
|
|||
params['project']['name'] = params['value']
|
||||
end
|
||||
|
||||
@project.attributes = params['project']
|
||||
@project.attributes = project_params
|
||||
@saved = @project.save
|
||||
if @saved
|
||||
@project.transition_to(@new_state) if @state_changed
|
||||
|
|
@ -342,4 +342,10 @@ class ProjectsController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def project_params
|
||||
params.require(:project).permit(:name, :position, :user_id, :description, :state, :default_context_id, :default_tags)
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue