1. CSS
  2. Flash
  3. HTML
  4. Illustrator
  5. Java
  6. JavaScript
  7. Maya
  8. Photography
  9. Photoshop
  10. PHP
  11. Ruby
  12. Ruby on Rails
  13. 3ds Max

Ruby on Rails: Simplifying Rails Controllers with named_scopes

  1. Clicks today:
    0
  2. Clicks this month:
    0
  3. Overall rating:
    4.00/5

Ruby on Rails » Refactoring — almost 8 years ago
So named_scope is great. It's a quick and clear way to share common SQL fragments within your app by defining them in your models. But one aspect of scopes that might not be immediately apparent is how much logic you can strip from your controllers this way.

Comments

Your Comment

You must be logged in to post a comment.