[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Hi /g/ I recently started learning Ruby on Rails For my first
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 9
Thread images: 1
File: ruby_and_rails.jpg (69 KB, 1000x709) Image search: [Google]
ruby_and_rails.jpg
69 KB, 1000x709
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.
Thread replies: 9
Thread images: 1

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.