-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MediaRanker Waves1-3 #44
base: ash/master
Are you sure you want to change the base?
Conversation
end | ||
|
||
def show | ||
@book = Book.find(params[:id]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you use this line several times, you can DRY up your code by extracting it into a separate private method and calling that method instead. You can then also set it up as a before action scoped to show, edit, and update. Eg.
before_action: find_book, only: [:show, :edit, :update]
private
def find_book
return Book.find(params[:id])
end
Really nice job on this project, @annaleeherrera . I like how clean and readable your code is. I left a few comments about consistency in formatting and a few tips for DRYing it up, but in general you're doing a great job at writing easy-to-read code, and it looks like you have a good understanding of Rails routing conventions and form helpers. The decision of whether to put code in Controllers or Models can be subjective, and you'll develop your own feeling for where you like to put various types of logic. Keep up the good work! |
Last thing to do: Hide files in GitIgnore
Completed waves 1-3