Skip to content

belaymit/Blog-App-ror

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

147 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

logo

Blog App

πŸ“— Table of Contents

πŸ“– Blog-app-ror

Blog-app-ror is a simple blog app that is created to learn more about ruby on rails and postgresql

Learning objectives

  • Install Ruby on Rails framework.
  • Use Ruby Gems as a software packages system.
  • Understand what ORM is.
  • Use database migration files to maintain database schema.
  • Set up associations between models.
  • Write SQL queries with Active Record.
  • Use validations for models.
  • Write unit tests for models.
  • Use controllers to handle requests and render empty views.
  • Understand Rails naming conventions.
  • Use params from browser requests in a safe way.
  • Use preprocessed HTML file with embedded Ruby code.
  • Use layouts and templates for shared content.
  • Use preprocessed HTML file with embedded Ruby code.
  • Use layouts and templates for shared content.
  • Write integration tests with Capybara gem.
  • Secure app from n+1 problems.

πŸ›  Built With

Tech Stack

Client
Database

Key Features

  • Database Models
  • Database Schema
  • Blog App

(back to top)

Schema Diagram

Schema-diagram

πŸ’» Getting Started

To get a local copy up and running, follow these steps.

Prerequisites

1. Install Rails

  • But before you install Rails, you should check to make sure that your system has the proper prerequisites installed. These include:
  • Ruby
  • SQLite3

In order to install ruby:

Select your platform

  • MacOS
  • Ubuntu
  • Windows

Tools on Unix based systems

There are several tools that can be used to install Ruby on your local machine. The most popular are:

   rbenv
   RVM
   asdf

We will go with rbenv because it does not override any of the system shell scripts like RVM and it allows us to compile older Ruby versions that will fail with RVM.

MacOS

Run the following commands in your terminal:

brew install rbenv ruby-build
echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile
source ~/.bash_profile
rbenv install 3.0.1
rbenv global 3.0.1
ruby -v

Note: If you are using a shell other than bash, for example zsh, you should change the first line to use zshrc like this:

echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.zshrc

or any other config file of your shell.

Ubuntu

You can install Ruby on Ubuntu in several ways. The easiest way is to run the following command (source):

  sudo apt-get install ruby-full

If that doesn't work, you can try installing Ruby using rbenv. This is a version manager tool for the Ruby programming language on Unix-like systems.

Run the following commands in your terminal:

git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
exec $SHELL

git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
exec $SHELL

rbenv install 3.0.1
rbenv global 3.0.1
ruby -v

consider checking Install ruby on Ubuntu 20.04 with rbenv.

Windows

Installing Ruby on Windows is a little more difficult than installing it on another OS. We would recommend using WSL, but you can also try to install Ruby directly on your OS with rubyinstaller.

WSL only works on 64-bit installations of Windows.

If you are using a 64-bit version of Windows 10, we recommend following this article to install Ruby.

If you can not use WSL then you should follow these steps:

Download the last version of RubyInstaller. Run RubyInstaller and follow the steps described here.

Check for your ruby version

 ruby --version
 ruby 2.7.0

To install Rails on Windows, you'll first need to install Ruby Installer.

Installing SQLite3

You will also need an installation of the SQLite3 database. Many popular UNIX-like OSes ship with an acceptable version of SQLite3. Others can find installation instructions at the SQLite3 website.

Check for your SQLite3 version

    sqlite3 --version

To install Rails, use the gem install command provided by RubyGems:

 gem install rails

Setup

Clone this repository to your desired folder:

  cd my-folder
  git clone git@github.com:belaymit/Blog-App-ror.git

Install

Install this project with:

  cd Blog-App-ror
  bundle install

Usage

To run the project, execute the following command:

  rails server

Run tests

To run tests, run the following command:

  rspec spec/models // to test models
  rspec spec/requests/controller_name_spec.rb // to test controllers
  rspec spec/views/user // to test views

(back to top)

πŸ‘₯ Authors

πŸ‘€ Belay Birhanu G

πŸ‘€ Victor Gonzalez

(back to top)

FUTURE FEATURES

  • Full Blog App
  • Delete Blogs
  • Update Blogs
  • Like and comment on Blogs

(back to top)

🀝 Contributing

Contributions, issues, and feature requests are welcome!

Feel free to check the issues page.

(back to top)

⭐️ Show your support

If you like this project please consider starring it

(back to top)

πŸ™ Acknowledgments

I would like to thank Microverse Community

(back to top)

❓ FAQ (OPTIONAL)

  • Why ruby on rails?

    • There are several reasons why developers choose Ruby on Rails as their web application framework of choice:
      • Productivity: Rails provides a lot of built-in features and conventions that make it easy to create a functional web application quickly. For example, it comes with its own ORM (Object Relational Mapping) system, which simplifies database interactions, and provides a lot of helper methods and templates to quickly build out common functionality.

      • Convention over configuration: Rails has a set of conventions that help developers to structure their code in a consistent and maintainable way. This means that developers can spend less time configuring their application and more time writing code.

      • Ruby programming language: Ruby is a very flexible and expressive programming language that is easy to read and write. It allows developers to focus on the business logic of their application rather than getting bogged down in boilerplate code.

      • Active community: Ruby on Rails has a very active and supportive community of developers who contribute to the framework and share their knowledge and expertise through various online resources and forums.

      • Scaling: Rails is designed to scale well, and there are many tools and techniques available to help developers scale their applications as their user base grows.

(back to top)

πŸ“ License

This project is MIT licensed.

(back to top)

About

About Blog app is a classic example of a blog website. That allows you to create new posts, displays a list of posts and empower readers to interact with them by adding comments and liking posts.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors