Create the ecommerce application implementation using Ruby on Rails 6.
You can try it at https://rails6shop.herokuapp.com/
Account login on Backend
user :
username: tanhong1 | password: tanhong1
- Ruby on Rails
We are going to build the web application using:
- Rails 6.0.3.2
- Ruby 2.7.1
1. Product Manager
2. Using a Helper to Format the Price
3. Create cart
4. Ajax-Based Cart
5. Check Out Order
6. Login, Logout, Authenticating Users, User Manager
7. Internationalization
8. Receive Emails and Respond with Rich Text
9. Pagination, Search
...
$ git clone https://github.com/TanHongIT/ruby_on_rails_6_shop
$ cd ruby_on_rails_6_shop
$ bundle install
$ yarn install
You must change the appropriate database configuration
Change configuration at "config/database.yml" with Postgresql.
default: &default
adapter: postgresql
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
timeout: 5000
username: ruby_on_rails_6_shop
password: 1234
host: localhost
# tutorial for ubuntu linux:
# sudo -u postgres psql
# create user "ruby_on_rails_6_shop" with password '1234';
# create database "ruby_on_rails_6_shop" owner "ruby_on_rails_6_shop";
development:
<<: *default
database: ruby_on_rails_6_shop_6
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
<<: *default
database: ruby_on_rails_6_shop_test
production:
<<: *default
database: ruby_on_rails_6_shop_production
You must change the username, password and database name accordingly!
$ rails db:migrate
$ rails db:migrate RAILS_ENV=development
$ bundle exec figaro install
user_mail: '[email protected]'
user_password: 'your password'
class ApplicationMailer < ActionMailer::Base
default from: 'change_your_mail'
layout 'mailer'
class OrderMailer < ApplicationMailer
default from: 'Tan Hong <[email protected]>'
class SupportRequestMailer < ApplicationMailer
# Subject can be set in your I18n file at config/locales/en.yml
# with the following lookup:
#
# en.support_request_mailer.respond.subject
#
default from: "[email protected]"
class ApplicationMailbox < ActionMailbox::Base
routing "[email protected]" => :support
end
$ bundle exec rake webpacker:install
We use loop to load data into database, run the following commands in turn:
$ rails runner bin/create_dummy_orders.rb
$ rails runner bin/create_dummy_products.rb
$ rails runner bin/create_dummy_users.rb
$ rails s
Account login on Backend
user :
username: tanhong1 | password: tanhong1
Support this project π π