Skip to content

Commit

Permalink
Refs issue #14: Add the updating functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
Markus-Brand committed Nov 3, 2017
1 parent 1e664ec commit d659405
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions app/controllers/authors_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ def create
end
end

def update
@author = Author.find(params[:id])

if @author.update(author_params)
redirect_to @author
else
render 'edit'
end
end

private
def author_params
params.require(:author).permit(:first_name, :last_name, :homepage)
Expand Down

0 comments on commit d659405

Please sign in to comment.