Rails: Users save they favorite posts [closed] - ruby-on-rails

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
First sorry for my English;
For learning purpose I have create a blog with authentication ( I am using Devise), Now I want that user to be able to save other users posts so when they visit the Saved posts pages they will see posts saved, how can I do it

You can model the association
Business Logic
Users can have multiple posts
Users can save multiple posts
A Post can be saved by multiple users but have one owner

Related

Rails: How to lock ActiveRecords in order to avoid collisions in data trafic? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
How can we lock an ActiveRecord and complete the operations on it before allowing another thread or request to make changes to the ActiveRecord?
I am building an eCommerce site which currently has a huge discount
campaign. Only one unit of your product left. And many people want to
buy it at the exact same time. In such scenario, I need to lock the
product?
In Rails, you could use with_lock
https://apidock.com/rails/ActiveRecord/Locking/Pessimistic/with_lock

Model student, subject, marks. Application logic [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I have Student that has_many Subjects thas has_one Mark. Where should I write logic to sum all student marks from one subject ? Im beginner so any links to documentation or somewhere else are appreciated.
Almost any time I need to interact with multiple models, I use a plain old Ruby object (aka, a "PORO"). I personally call these 'managers', but I believe it's more common to call them 'service' objects (or some variation). Google 'Rails service objects' and that ought to get you started.

User can switch on their profile visibility on and off [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
Hi I want to be able to let users show and hide the visibility of their 'profile' page in a rails application, indicating their availability to other users.
Currently looking for a simple solution.
Add a visibility flag editable by users and filter profile index by it

Building app -- need info on viewing other users playlists [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I am currently building an app and would like the option of having users view other users playlists. Is this possible?
Of course this is possible. All this data would be in a database, and you would write stored procedures that would fall in a REST API that you would call from your app. You would need to do the filtering of said stored procedure to show users any kind of data you want (if you only want to show 'friends' playlists, or 'people around you'..etc). Remember, it's just all data. Nothing more. You format the data to look nice, but it's still just data.

Adding a two way authorization in a Ruby on Rails application [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I want to add a two way authorization in my ruby app, just like freelancer has for work and hire. Is there an easy way to do this. In my app there will be two types of users buyer and seller. Seller will have the power to post adds and buyer can bid on them. that's all
For authentication purpose, you can use Devise and for roles (buyer/seller or client/freelancer) management, you have CanCan
You can refer to this tutorial:
Rails Authentication with Devise & CanCan

Resources