bolah2009 / members-only

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Project: Members-only (Ruby on Rails)

This is the fifth project of the Main Rails curriculum at Microverse - @microverseinc

  • The objective is to build and implement an authentication system so users can only access areas of a site they are authorized to.
  • The main focus will be on data and function as there will be less focus on the styling

Members-only (Ruby on Rails)

More about the project

Relationship
- Post `belongs_to` User
- User `has_many` posts
Validations

No validations is set for both the User and Post model User model have the has_

Usage Instructions

Clone the project

  • Clone the repo and run the app.
$ git clone git@github.com:bolah2009/members-only.git
$ cd members-only

Run bundle install and migrate as follows:

bundle install

rails db:migrate
rails db:seed

Run the rails console

rails console

Creating a sample user and testing the #authenticate method

> user = User.create(:name => "Chief", :email => "chief@email.com", :password => "password", :password_confirmation => "password")
> user.authenticate("wrongpassword")
=> false
> user.authenticate("password")
=> #<User id: 1, name: "Chief", email: "chief@email.com", password_digest: "$2a$10$9Lx...", created_at: "2019...", updated_at: "2019...">

Screenshots

Show all posts (Without Author)

http://localhost:3000/ or http://localhost:3000/posts

Show all posts (Without Author)

Show all posts (With Author, logged in users)

http://localhost:3000/ or http://localhost:3000/posts Show all posts (With Author, logged in users)

Login page

http://localhost:3000/login Login Page

Create new post

http://localhost:3000/posts/new Create new post

Ruby version

ruby 2.6.3p62

Rails version

Rails 5.2.3

Authors

About


Languages

Language:Ruby 72.7%Language:HTML 16.7%Language:CSS 6.5%Language:JavaScript 2.7%Language:CoffeeScript 1.4%