Revision 13277
Added by Jean-Philippe Lang almost 11 years ago
sandbox/rails-4.1/app/controllers/documents_controller.rb | ||
---|---|---|
69 | 69 |
|
70 | 70 |
def update |
71 | 71 |
@document.safe_attributes = params[:document] |
72 |
if request.put? and @document.save
|
|
72 |
if @document.save |
|
73 | 73 |
flash[:notice] = l(:notice_successful_update) |
74 | 74 |
redirect_to document_path(@document) |
75 | 75 |
else |
sandbox/rails-4.1/app/controllers/enumerations_controller.rb | ||
---|---|---|
56 | 56 |
end |
57 | 57 |
|
58 | 58 |
def update |
59 |
if request.put? && @enumeration.update_attributes(params[:enumeration])
|
|
59 |
if @enumeration.update_attributes(params[:enumeration]) |
|
60 | 60 |
flash[:notice] = l(:notice_successful_update) |
61 | 61 |
redirect_to enumerations_path |
62 | 62 |
else |
sandbox/rails-4.1/app/controllers/project_enumerations_controller.rb | ||
---|---|---|
20 | 20 |
before_filter :authorize |
21 | 21 |
|
22 | 22 |
def update |
23 |
if request.put? && params[:enumerations]
|
|
23 |
if params[:enumerations] |
|
24 | 24 |
Project.transaction do |
25 | 25 |
params[:enumerations].each do |id, activity| |
26 | 26 |
@project.update_or_create_time_entry_activity(id, activity) |
sandbox/rails-4.1/app/controllers/repositories_controller.rb | ||
---|---|---|
69 | 69 |
@repository.merge_extra_info(attrs[:attrs_extra]) |
70 | 70 |
end |
71 | 71 |
@repository.project = @project |
72 |
if request.put? && @repository.save
|
|
72 |
if @repository.save |
|
73 | 73 |
redirect_to settings_project_path(@project, :tab => 'repositories') |
74 | 74 |
else |
75 | 75 |
render :action => 'edit' |
sandbox/rails-4.1/app/controllers/roles_controller.rb | ||
---|---|---|
69 | 69 |
end |
70 | 70 |
|
71 | 71 |
def update |
72 |
if request.put? and @role.update_attributes(params[:role])
|
|
72 |
if @role.update_attributes(params[:role]) |
|
73 | 73 |
flash[:notice] = l(:notice_successful_update) |
74 | 74 |
redirect_to roles_path |
75 | 75 |
else |
sandbox/rails-4.1/app/controllers/versions_controller.rb | ||
---|---|---|
117 | 117 |
end |
118 | 118 |
|
119 | 119 |
def update |
120 |
if request.put? && params[:version]
|
|
120 |
if params[:version] |
|
121 | 121 |
attributes = params[:version].dup |
122 | 122 |
attributes.delete('sharing') unless @version.allowed_sharings.include?(attributes['sharing']) |
123 | 123 |
@version.safe_attributes = attributes |
Also available in: Unified diff
Don't check request method in #update actions as we get PATCH requests now. PUT requests must be accepted for the API.