In Budjet you can manage your budget by having a list of transactions associated with a category, so that you can see how much money you spent and on what, add a category, and a 'Transactions' page where you can see your payments and add more.
- Ruby on Rails
- RSpec
💻 Demo
- Node.js
- Yarn
- Ruby
- Ruby on Rails
- Bullet
- Capybara
- Devise
- Cancancan
Follow these steps on your console to properly clone this repository on your desktop:
$ cd desktop
$ git clone 'repo_path'
$ cd 'repo_name'
$ code .
Run 'ruby file_name' to see outputs in the console.
Run 'rubocop' to check linter offenses.
Create database for the project with bin/rails db:create, otherwise create databases manually in PostgreSQL.
If necessary, add username and password in config/database.yml for development and test:
development:
<<: *default
database: Budget_app_development
host: ''
username:
password:
test:
<<: *default
database: Budget_app_test
username:
password:
Add the following gems into your Gemfile general, development and test groups:
gem 'cancancan'
gem 'devise'
gem 'rubocop', '>= 1.0', '< 2.0'
gem 'font-awesome-sass', '~> 6.2.0'
gem 'sassc-rails'
group :development, :test do
gem "debug", platforms: %i[ mri mingw x64_mingw ]
gem "database_cleaner"
gem 'ffi'
gem 'rspec-rails'
gem 'rails-controller-testing'
end
group :development do
gem "web-console"
gem 'bullet'
end
group :test do
# Use system testing [https://guides.rubyonrails.org/testing.html#system-testing]
gem "capybara"
gem "selenium-webdriver"
gem "webdrivers"
end
Install all gems bundle install.
- Set up RSpec in your app and create the Spec folder
rails g rspec:install. - Run the migration into your testing environment
rails db:migrate RAILS_ENV=test. - Note: to see all tests with description run
rspec spec --format documentation.
- Set up bullet gem by running:
bundle exec rails g bullet:install. - Make sure the following snippet is in your
config/environments/development.rbfile:
Rails.application.configure do
config.after_initialize do
Bullet.enable = true
Bullet.alert = true
Bullet.bullet_logger = true
Bullet.console = true
Bullet.rails_logger = true
Bullet.add_footer = true
end
- Use the provided command to generate a template for your abilities file:
rails generate cancan:ability
- Run the Devise generator
$ rails generate devise:install - Make sure to add the following line of code in your
config/environments/development.rbfile:
config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
- In the following command you will replace
MODELwith the class name used for the application’s users (it’s frequentlyUserbut could also beAdmin). This will create a model (if one does not exist) and configure it with the default Devise modules. The generator also configures yourconfig/routes.rbfile to point to the Devise controller.
$ rails generate devise MODEL
- Then run
rails db:migrate - Note: you should restart your application everytime after changing Devise's configuration options.
- Make sure to add
require "capybara/rspec"in yourspec/rails_helperfile:
ENV["RAILS_ENV"] ||= "test"
require File.expand_path("../../config/environment", __FILE__)
abort("The Rails environment is running in production mode!") if Rails.env.production?
require "spec_helper"
require "rspec/rails"
# Add additional requires below this line. Rails is not loaded until this point!
require "capybara/rspec"
...
end
- Rename the file
app/assets/stylesheets/application.cssto../application.css.scss. - Make sure to add
@import "font-awesome";at the end of yourapp/assets/stylesheets/application.css.scssfile. - Note: It should be below the
*= require_selfand outside the comment*/snippet.
- GitHub: @mikemtzp
- Twitter: @mikemtzp
- LinkedIn: Mike Martínez
Contributions, issues, and feature requests are welcome! Feel free to check the issues page.
Give a ⭐️ if you like this project!
- This project was built based on the original template design idea by Gregoire Vella in Behance.
- This README.md was elaborated with the Microverse readme-template