Forum: Ruby on Rails how can a user contact another user

5f8123548ad5cb3ca03e5f6e5ea33d6e?d=identicon&s=25 Friederike Geiken (ike)
on 2014-08-15 02:52
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?
B5811ff5bb3b559d7c0f77ddbf407e3c?d=identicon&s=25 Colin Mr. (cbstodd)
on 2014-08-15 15:59
(Received via mailing list)
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
5f8123548ad5cb3ca03e5f6e5ea33d6e?d=identicon&s=25 Friederike Geiken (ike)
on 2014-08-15 16:13
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?
Bee69cfed999cd13e3bff73d472a39ee?d=identicon&s=25 Hassan Schroeder (Guest)
on 2014-08-15 16:32
(Received via mailing list)
On Thu, Aug 14, 2014 at 5:52 PM, Friederike Geiken
<lists@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.schroeder@gmail.com
http://about.me/hassanschroeder
twitter: @hassan
5f8123548ad5cb3ca03e5f6e5ea33d6e?d=identicon&s=25 Friederike Geiken (ike)
on 2014-08-15 16:38
Hassan Schroeder wrote in post #1155231:
> On Thu, Aug 14, 2014 at 5:52 PM, Friederike Geiken
> <lists@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.schroeder@gmail.com
> http://about.me/hassanschroeder
> twitter: @hassan


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?
Bee69cfed999cd13e3bff73d472a39ee?d=identicon&s=25 Hassan Schroeder (Guest)
on 2014-08-15 16:45
(Received via mailing list)
On Fri, Aug 15, 2014 at 7:38 AM, Friederike Geiken
<lists@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  :-)

--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
http://about.me/hassanschroeder
twitter: @hassan
5f8123548ad5cb3ca03e5f6e5ea33d6e?d=identicon&s=25 Friederike Geiken (ike)
on 2014-08-15 16:49
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.
Bee69cfed999cd13e3bff73d472a39ee?d=identicon&s=25 Hassan Schroeder (Guest)
on 2014-08-15 16:58
(Received via mailing list)
On Fri, Aug 15, 2014 at 7:49 AM, Friederike Geiken
<lists@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.

--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
http://about.me/hassanschroeder
twitter: @hassan
Aa082c8b00a50928e5860dcd70bf2368?d=identicon&s=25 tamouse m. (tamouse_m)
on 2014-08-17 18:56
(Received via mailing list)
On Fri, Aug 15, 2014 at 9:49 AM, Friederike Geiken
<lists@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.
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.