Last active
August 29, 2015 14:07
-
-
Save bgvo/fba173bf0b1ab1f12985 to your computer and use it in GitHub Desktop.
Abstract json rendering outside controller
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
render json: { | |
item: { | |
name: item.name, | |
kind: item.kind, | |
details_en: item.details_en | |
}, | |
rating: item.ratings.where(user_id: @current_user.id) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment