Skip to content

Instantly share code, notes, and snippets.

@urbed
urbed / Questions.md
Last active March 9, 2017 12:15
Any comments please?
  1. Im reasonably happy to live with the method in the controller, unless you say otherwise.

  2. I've looked in vain for an authorative answer for the 'neater syntax' part of this: If I wanted a categories controller with simpy a param[:id] for both URLs below, what would I write in routes.rb please? I reckon this involves writing two GET directives in a particular order in routes.rb, but is there a neater syntax?

  GET /categories/:id/show_full    categories#show_full
  GET	 /categories/:id             categories#show
  1. So I believe I'm doing three (N+1) queries to display that page. If I was concerned about performance (one day I will be) what lines of attack do I have to reduce a performance hit?

Thanks!