Coder Social home page Coder Social logo

micro-reddit's Introduction

MICRO-REDDIT

This rails application features a User, Post and Comment Model. It illustrates a system where the user can create posts and comment on them.

How to run Micro-Reddit

To run it, clone this repository locally, and run these commands on your terminal.

cd ~/micro-reddit
rails console

You can the create new users, posts or comments by simply typing


User.create(name: "Example User", email: "[email protected]", password: "foobar", password_confirmation: "foobar")
Post.create(user_id: "user_id", link: "link_address")
Comment.create(user_id:"user_id", post_id: "post_id", body: "any content")

on the console prompt. NB: Enter the parameters for _id's as intergers

For more details on how to naviagte through the application, please visit link on OdinProject!

Model Associations

User Model

A user 'has_many' posts and 'has_many' comments.

Post Model

A post 'belongs_to' a user and 'has_many' comments.

Comment Model

A comment 'belongs_to' a user and also 'belongs_to' a post.

micro-reddit's People

Contributors

mosesogwo avatar uche-inyama avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.