Created
July 20, 2014 15:18
-
-
Save thanhcuong1990/60ff7bd7b13372f2a147 to your computer and use it in GitHub Desktop.
Scope examples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /app/controllers/posts_controller.rb | |
def index | |
@posts = current_user.posts.recent.limit(10) | |
#... | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment