I am not sure I fully get your question but I'll give it a try.
You need to implement user sign in/sign out. In this way each user will have his own list of tracks.
Use the devise gem. It is well tested and gives you all you need.
You can read more about Rails session here: http://guides.rubyonrails.org/security.html
Hope this help.
UPDATE
Each user that comes to your website gets a unique session thus you can use the session_id in place of the user_id.
Super simple solution:
Step 1: add a column to the tracks table called user_id (do not forget to add an index as well), session_id is a string.
Step 2: create a before_filter in your application_controller that sets the user variable:
class ApplicationController
before_filter:set_user
# ...
def set_user
@user_id = cookies['_session_id'] # @user_id is a string
end
# ....
end
Step 3: in your create method do something like this
# ...
# Note this code is just to give you an idea
@new_track = Track.new(query: @trackinfo)
@new_track.user_id = @user_id
@tracks = Track.where(user_id: @user_id)
# ....
NOTE: A more flexible solution requires a users table and setting the current_user variable based on the user_id stored into the session. See the link above.
Hope this help.