✅ Created a new rails app.
✅ Followed gitflow
✅ Setup PostgreSQL database.
✅ For each URL I created:
- A route.
- Action in the correct controller.
- A view file.
✅ Add RSpec as a gem to your project.
✅ Create a Request spec file for all your controllers.
✅ Make sure that for each action you check:
- If the response status was correct.
- If a correct template was rendered.
- If the response body includes correct placeholder text.
✅ Wrote commands to create new models and their migrations.
✅ Wrote commands to generate schema.rb
✅ Added foreign keys with their indexes.
✅ Added some records to the database. ✍️
✅ Wrote some methods to update the database counters. 🔢
✅ Used seeds.rb and rails console. 🌱
✅ Implemented the design from the sneak peek wireframes. 🖥️
✅ Added basic styling 🎨
✅ Used methods from models. 📈
✅ Used partials to keep the code DRY 🏜️
✅ Create forms to perform the following functions:
✔️ Creates a Post on behalf of the current_user. 📄
✔️ Create a comment on behalf of the current_user. ✍️
✅ Allow Users to add likes to Posts. 👍
✅ Added the following validations:
✔️ For the User model:
☑️ Name must not be blank.
☑️ PostsCounter must be an integer greater than or equal to zero.
✔️ For the Post model:
☑️ Title must not be blank.
☑️ Title must not exceed 250 characters.
☑️ CommentsCounter must be an integer greater than or equal to zero.
☑️ LikesCounter must be an integer greater than or equal to zero.
✅ Added unit specs for all of your models' methods and validations.
✅ Added flash messages in the create actions in all your controllers.
✅ Solved issue N+1 using Bullet gem
✅ Added some styling to improve the UI 🎨
✅ Installed devise gem 💎
✅ User is able to:
✅ Can register a new user. 🧑💻
✅ User logs in with a combination of email and password. 🔑 📫
✅ Hashed passwords should be stored in the database. 🗝️
✅ Ask for confirmation of email. 📩
✅ Can reset password. 🔑
For this PR I tested some functionalities of the app using RSpec and Capybara.
✅ Login page 👨💻
✅ User index page 📄
✅ User show page 💻
✅ User post index page ✍️ ⌨️
✅ Post-show page 🖥️ 📃
- Ruby On Rails
Open your termnial and run the following command:
git clone https://github.com/AlexRS90/blog-app.git
- cd blog-app
- bundle
- rails db:create
- rails db: migrate
rails s
Open your browser and type the following URL http://127.0.0.1:3000/
Finally you can start using the app and add some post, comments and likes. Enjoy!
User.create!(name: 'Alex', photo: 'https://lh3.google.com/u/0/d/1Rf6vRehHE5NqXss9gvR8Xh2KCCKcZR3n=w1440-h789', bio: 'Full-Stack Web Developer', post_counter: 0)
User.create(name: 'Tom', photo: 'https://media.istockphoto.com/photos/young-handsome-man-with-beard-wearing-casual-sweater-standing-over-picture-id1212702108?k=20&m=1212702108&s=612x612&w=0&h=ZI4gKJi2d1dfi74yTljf4YhulA1nfhD3dcUFGH-NUkY=', bio: 'Teacher from Mexico.', post_counter: 0)
User.create(name: 'Lilly', photo: 'https://media.istockphoto.com/photos/cute-and-happy-teen-girl-with-braces-smiling-to-camera-picture-id1299140003?k=20&m=1299140003&s=612x612&w=0&h=c9d6mpWwHv1pgYg1vhSHlnA4GGUoS982oyrcdtHmrtI=', bio: 'Teacher from Poland.', post_counter: 0)
To run the unit test once you did the above steps just write the following command in your terminal, you must be on your root directory:
rspec spec
- Ruby
- Terminal
👤 Alejandro Ramos
- GitHub: @AlexRS90
- Twitter: @AlejandroRBenji
- LinkedIn: @AlexRS90
👤 Mateo Villagómez
- GitHub: @mateo951
- Twitter: @MVGameDev
- LinkedIn: @Mateo Villagómez
Contributions, issues, and feature requests are welcome!
Give a ⭐️ if you like this project!
This project is MIT licensed.