Skip to content

Instantly share code, notes, and snippets.

@costajob
Created February 15, 2016 15:58
Show Gist options
  • Save costajob/d763cd22026f062babb0 to your computer and use it in GitHub Desktop.
Save costajob/d763cd22026f062babb0 to your computer and use it in GitHub Desktop.
def stores_for_user
@stores = OsaUser.find_all_by_user(params[:user]).
map{|x| [x.store_code, x.store_description]}.uniq unless params[:user].blank?
respond_to do |format|
format.json { render :json => @stores}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment