ruby - Comment notification to users in rails? -


There are registered users in my webpage and there are articles, blog posts, gossip, etc. I have a polymorphic comment for all of these resources The model is listed below.

id content commentable_id commentable_type user_id created_at updated_at 1 freest comment 2 paragraph 1 .... 2 second comment 3 post 2 ....

For commentable resources, I have a comment form below the remarkable resource that users have to comment on. I need a checkbox when checked when submitting comments, users should receive a notification, be in the inbox or email, because we already have user signup, when other new comments are added later .

I want notifications like some models, where I can store commentable_type, commentable_ID and user_id (if the mailing is commentable and should be sent to the user when a new comment is made? )

How can I apply the relationship between comment and notification? If anybody subscribes to a particular commentable resource for the part of the investigation, create a comment Observer with hook to initiate the search and send notifications when a match is recorded.

But I'm confused that the union, model, controller and idea want to accomplish it? Since the comment model is already polymorphic, can I even make the notification model as polymorphic ??

You can easily complete it without plug-in to store user notification subscriptions for posts To create a database table. Then, every time you make a comment, inquire the database and send an email to all users' addresses.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -