Skip to content

MediaRanker Waves1-3#44

Open
annaleeherrera wants to merge 12 commits intoAda-C4:ash/masterfrom
annaleeherrera:ash/master
Open

MediaRanker Waves1-3#44
annaleeherrera wants to merge 12 commits intoAda-C4:ash/masterfrom
annaleeherrera:ash/master

Conversation

@annaleeherrera
Copy link
Copy Markdown

Last thing to do: Hide files in GitIgnore

Completed waves 1-3

@a-lmx a-lmx self-assigned this Jan 6, 2016
Copy link
Copy Markdown

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

@a-lmx
Copy link
Copy Markdown

a-lmx commented Jan 6, 2016

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants