by Jinook Jung
- Visit my Github repository and clone the code to your local directory:
git clone https://github.com/jinook929/_flatiron_project2.git
- Enter into the _flatiron_project2 folder:
cd _flatiron_project2
. - Execute
bundle install
and runshotgun
in terminal. - Then, open your browser at
http://localhost:9393/
.
- You can either sign up for your own account or use the existing accounts to log in.
- Before logging in, user still can see vlog list by countries and each individual vlog from there, but no more than that.
- If you log in as
super
(password: 123), you can create, read, update, and delete vlogs, comments, and even users, like making someone else admin, except for deleting yourself. - If you log in as
admin
(password: 123), you can create, read, and update vlogs, and create, read, update, and delete comments, and read the users. - If you log in as normal user (
user
, password: 123), you can create, update, and delete your own vlogs and comments, and read all vlogs and comments. - Each user has access to his/her own profile (user info, vlog info, country info, and comment info) through
Welcome, USER
link on the navbar. - Keyword search is available for any logged-in user via the search box on the navbar.
t.string :username
t.string :email
t.string :password_digest
t.boolean :admin, default: false # (except for the first user)
t.boolean :super, default: false # (except for the first user)
t.string :title
t.text :content
t.string :youtube
t.integer :country_id
t.integer :user_id
t.string :name
t.string :url
t.string :content
t.integer :post_id
t.integer :commenter_id
has_many :posts
has_many :comments, foreign_key: "commenter_id"
has_many :countries, through: :posts, source: :country
has_many :commented_posts, through: :comments, source: :post
has_secure_password
validates :username, presence: true
validates :username, uniqueness: true
validates :email, presence: true
validates :email, uniqueness: true
validates :password, presence: true
belongs_to :user
belongs_to :country
has_many :comments
has_many :commenters, through: :comments, source: :user
validates :title, presence: true
validates :content, presence: true
validates :youtube, presence: true
belongs_to :post
belongs_to :commenter, class_name: "User"
validates :content, presence: true
has_many :posts
validates :name, presence: true
Bug reports and pull requests are welcome on GitHub at https://github.com/jinook929/_flatiron_project1. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
- Jinook Jung jinook929@gmail.com
© Jinook Jung
The app is available as open source under the terms of the MIT License.