Blogger allow users to edit blogs anywhere through the app and either publish the blogs or save them as drafts, we have created a fully functional website that will show the list of posts and empower readers to interact with them by adding comments and liking posts, add validations to the models, create specs for them.
- Install git.
- Install Postgres.
- Install rails
$ git clone https://github.com/joskalenda/blog-app.git
$ cd blog-app
$ rails s # or
$ rails server # or
- You can now visit
http://localhost:3000
to view your new website!
You can also execute the rails routes
command in your terminal to produce the same output.
- At the first you need to include those lines in your Gemfile
gem 'rails-controller-testing'
gem 'rspec-rails'
$ rails generate rspec:install
-
This should generate some files that you will need to run your tests and should give us a Controller and a View
-
Then run:
$ rspec spec # to test if your tests are passed
$ rails generate controller home index show
$ rails generate controller users index show
$ rails generate controller posts index show
$ rails generate model User name photo bio:text posts_counter:integer
$ rails generate model Post title text:text comments_counter:integer likes_counter:integer author:references
$ rails generate model Like author:references post:references
$ rails generate model Comments text:text author:references post:references
- To push the Migration into the database
$ rails db:migrate
👤 Jos Kalenda
- GitHub: @Joskalenda
- Twitter @Joskalenda
- LinkedIn @Joskalenda
Contributions, issues, and feature requests are welcome!
Feel free to check the issues page.
Give a ⭐️ if you like this project!
- Hat tip to anyone whose code was used
- Inspiration
- etc
This project is MIT licensed.