-
-
Save gcampbell391/1a42ada81a827388a60e11c0b4756518 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
class UsersController < ApplicationController | |
#Example of a common index route...Returns all users in json format | |
def index | |
users = User.all | |
render json: users, include: [:user_friends] | |
end | |
#This will be our custom add_friend action | |
def add_friend | |
#logic to add a friend | |
user = User.find(params[:id]) | |
byebug | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment