Created
January 6, 2017 15:13
-
-
Save phensalves/76b5b3e5e57d1d213a4374adde0fffd5 to your computer and use it in GitHub Desktop.
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
def list_favorite_bars bar_id | |
@favorite_bars = get_favorite_bars(params[:bar_id]) | |
respond_to do |format| | |
format.json { render :json => @favorite_bars} | |
end | |
end | |
private | |
def get_favorite_bars bar_id | |
Bar.select([:name, :short_description, :star_rating, :price_rating]).where("latitude IS NOT NULL AND longitude IS NOT NULL").find_all_by_id(bar_id) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment