how can a user contact another user

57 views
Skip to first unread message

Friederike Geiken

unread,
Aug 14, 2014, 8:53:33 PM8/14/14
to rubyonra...@googlegroups.com
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?

--
Posted via http://www.ruby-forum.com/.

Friederike Geiken

unread,
Aug 14, 2014, 8:53:50 PM8/14/14
to rubyonra...@googlegroups.com

Colin Law

unread,
Aug 15, 2014, 3:54:13 AM8/15/14
to rubyonra...@googlegroups.com
On 15 August 2014 01:53, Friederike Geiken <li...@ruby-forum.com> wrote:
> 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.

Do you mean send an email? If so then have a look at the Rails Guide
on ActionMailer.

Colin

Colin Stodd

unread,
Aug 15, 2014, 9:58:25 AM8/15/14
to rubyonra...@googlegroups.com
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

Friederike Geiken

unread,
Aug 15, 2014, 10:14:33 AM8/15/14
to rubyonra...@googlegroups.com
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?

Friederike Geiken

unread,
Aug 15, 2014, 10:15:34 AM8/15/14
to rubyonra...@googlegroups.com
Not exactly. I don't want to send an email to a user. A user should be
able to fill out a contact form, which than goes to the listing user.
So 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?

Hassan Schroeder

unread,
Aug 15, 2014, 10:31:45 AM8/15/14
to rubyonrails-talk
On Thu, Aug 14, 2014 at 5:52 PM, Friederike Geiken <li...@ruby-forum.com> wrote:

> Here, users can send the listing user a message.

> Or does anyone know how to program this?

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

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

Doesn't seem too complex :-)

HTH,
--
Hassan Schroeder ------------------------ hassan.s...@gmail.com
http://about.me/hassanschroeder
twitter: @hassan

Friederike Geiken

unread,
Aug 15, 2014, 10:38:59 AM8/15/14
to rubyonra...@googlegroups.com
Hassan Schroeder wrote in post #1155231:
Hm... I'm sorry. I'm very new to ROR so there are many things still
tricky for me.
Could you explain a little further?

Hassan Schroeder

unread,
Aug 15, 2014, 10:44:50 AM8/15/14
to rubyonrails-talk
On Fri, Aug 15, 2014 at 7:38 AM, Friederike Geiken <li...@ruby-forum.com> wrote:

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

> Hm... I'm sorry. I'm very new to ROR so there are many things still
> tricky for me.
> Could you explain a little further?

"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 :-)

Friederike Geiken

unread,
Aug 15, 2014, 10:49:50 AM8/15/14
to rubyonra...@googlegroups.com
The has one has many is clear.
But thanks I will definitely read over it again :)
I think what I'm struggling with more is how to actually deliver a
message from user to user.

Hassan Schroeder

unread,
Aug 15, 2014, 10:58:16 AM8/15/14
to rubyonrails-talk
On Fri, Aug 15, 2014 at 7:49 AM, Friederike Geiken <li...@ruby-forum.com> wrote:

> 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.

tamouse pontiki

unread,
Aug 17, 2014, 12:56:14 PM8/17/14
to rubyonra...@googlegroups.com
On Fri, Aug 15, 2014 at 9:49 AM, Friederike Geiken <li...@ruby-forum.com> wrote:
I think what I'm struggling with more is how to actually deliver a
message from user to user.

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.


Reply all
Reply to author
Forward
0 new messages