0

I need some suggestions on building a website with Rails as a newbie to programming

I am learning Rails by myself for around 2 months and I now want to build a website to connect individual consultants with individual clients.

My first problem is I am going to create 3 user models by using Devise (one for clients and one for consultants and one for admin) with the following main condition:

  1. Only users can post a question.
  2. Only the posting user and consultants can have comments on the question.
  3. Only user or admin can change the question's status (like solved or unsolved)

This is because consultant model will require more information to be provided than the client (not only the information but I want the consultants to verify themselves by submitting certificates etc. before becoming a part of professionals on my platform). Any gem to handle this? Or this is better to be achieved by STI using only 1 user model?

Actually, what I actually want to do at the end would be more complicated (and I still have no idea how to create it at this time), what I want to know at this point is that how can I handle 3 different models with the only 1 posting model (especially foreign key) because I am used to creating 1 user model for 1 posting model (and add Boolean for further management).

In addition, if I want to implement the in-app chat function, can I use the action cable for the private chat between the consultant and the client or should I make a new model for the private conversation between them, or do you have any gem to recommend?

Appreciate any comments.

Kamidesu
  • 111
  • 1
  • 9

1 Answers1

0

I am going to use STI to avoid any complication as provided in [https://stackoverflow.com/questions/9472852/devise-and-multiple-user-models?rq=1][1].

Kamidesu
  • 111
  • 1
  • 9