how can a user contact another user

I think this is a rather general question. I would like to implement the
following function in my website: Users can create different listings.
Other user can click on the listing and click a contact button that
links to a contact form. Here, users can send the listing user a
message.

Does anyone know a good reference, or a tutorial for this functionality?
Or does anyone know how to program this?

Not sure if this is what you are looking for, and you might have to go back and add other controllers etc from previous sections. But Michael Hartl’s tutorial has the “follow” feature in his sample_app… http://www.railstutorial.org/book/following_users

Colin Mr. wrote in post #1155224:

Not sure if this is what you are looking for, and you might have to go
back
and add other controllers etc from previous sections. But Michael
Hartl's
tutorial has the "follow" feature in his sample_app...
http://www.railstutorial.org/book/following_users

No, I followed his tutorial already.
I'm looking for a function that lets one user contact another user.
So the user goes to a users profile, looks at one of his
listing/postings. Now he would like to send the posting user an inquiry
about this posting.
The user should be able to click on a contact button, that lets him get
in contact with the listing user.
Does this make sense?

Think about what minimally addresses your scenario, e.g.

  user <has one> message queue <has many> messages

Doesn't seem too complex :slight_smile:

HTH,

Hassan Schroeder wrote in post #1155231:

"has_one" and "has_many" are very basic Rails (ActiveRecord)
association concepts. If that's not clear, read this:

  http://guides.rubyonrails.org/association_basics.html

Well, read all the guides, but that one first :slight_smile:

The has one has many is clear.
But thanks I will definitely read over it again :slight_smile:
I think what I'm struggling with more is how to actually deliver a
message from user to user.

You add the message to the user's message_queue.

That's what "delivered" means. Not complex.

That is what *you* need to define. People have suggested email (rejected by
you), a message queue (not understood). Step back and think about how you
want the receiving user to experience this. Then design your models
accordingly.