Commit 4dc573e8b036856c1e5b7a88500864181956c711
1 parent
7815bba3
Exists in
colab
and in
4 other branches
Removes image_url on update
Showing
1 changed file
with
2 additions
and
1 deletions
Show diff stats
app/controllers/projects_controller.rb
... | ... | @@ -46,7 +46,8 @@ class ProjectsController < ApplicationController |
46 | 46 | def update |
47 | 47 | set_project |
48 | 48 | @project_image = ProjectImage.find_by_project_id(@project.id) |
49 | - if @project.update(project_params) && @project_image.update(url: project_params[:image_url]) | |
49 | + image_url = project_params.delete(:image_url) | |
50 | + if @project.update(project_params) && @project_image.update(url: image_url) | |
50 | 51 | redirect_to(project_path(@project.id)) |
51 | 52 | else |
52 | 53 | render "edit" | ... | ... |