- π About the Project
- π» Getting Started
- π₯ Authors
- π Future Features
- π€ Contributing
- βοΈ Show your support
- π Acknowledgements
- β FAQ (OPTIONAL)
- π License
Blog-app-ror is a simple blog app that is created to learn more about ruby on rails and postgresql
- 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.
Client
Database
- Database Models
- Database Schema
- Blog App
To get a local copy up and running, follow these steps.
- But before you install Rails, you should check to make sure that your system has the proper prerequisites installed. These include:
- Ruby
- SQLite3
- MacOS
- Ubuntu
- Windows
There are several tools that can be used to install Ruby on your local machine. The most popular are:
rbenv
RVM
asdfWe 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.
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 -vNote: 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' >> ~/.zshrcor any other config file of your shell.
You can install Ruby on Ubuntu in several ways. The easiest way is to run the following command (source):
sudo apt-get install ruby-fullIf 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 -vconsider checking Install ruby on Ubuntu 20.04 with rbenv.
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.
ruby --version
ruby 2.7.0To install Rails on Windows, you'll first need to install Ruby Installer.
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.
sqlite3 --versionTo install Rails, use the gem install command provided by RubyGems:
gem install railsClone this repository to your desired folder:
cd my-folder
git clone git@github.com:belaymit/Blog-App-ror.gitInstall this project with:
cd Blog-App-ror
bundle installTo run the project, execute the following command:
rails serverTo 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π€ Belay Birhanu G
- GitHub: @githubhandle
- Twitter: @twitterhandle
- LinkedIn: LinkedIn
π€ Victor Gonzalez
- GitHub: @Vgonma
- Twitter: @Victor_GonMa
- LinkedIn: Victor Manuel Gonzalez Massimi
- Full Blog App
- Delete Blogs
- Update Blogs
- Like and comment on Blogs
Contributions, issues, and feature requests are welcome!
Feel free to check the issues page.
If you like this project please consider starring it
I would like to thank Microverse Community
-
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.
-
- There are several reasons why developers choose Ruby on Rails as their web application framework of choice:
This project is MIT licensed.

