Hi /g/
I recently started learning Ruby on Rails
For my first project I decided to make image-board
So I implemented basic features like making post,adding image file and all that simple stuff
Now I need to make reply system
Do any of you guys have idea how to do it?
Yeah
>>54424061
install gentoo
>>54424061
SQL
Main comment foreign key
Replies primary key
>ruby on rails
what it this? 2006?
>>54425532
+10
>>54424061
Sounds like you need a graph db. I suggest using a Neo4j server (it's the most accessible one out there, but the front end it comes with is kind of shit). In this way, you can flatly map relationships between all the posters, posts and replies.
SQL isn't the correct tool for this because you'll run into a nested replies-on-replies problem, where you'll have to continue to query an indeterminate number of times, where you cannot predict how many levels you're going to have to query through and so can't make the SQL performant.
Alternatively, you could have one of those shit sites where you have to click every time you want to "see replies" to any message you see. In that case SQL is fine, but that's such a shitty way of doing things and, since you're building from scratch, don't fucking do that.
thread has_many posts
post belongs_to thread
use paperclip gem to do image uploads
>>54426186
This. It's so easy to set this kind of shit up with RoR because of all the available gems.