Rails 6 with Webpacker 6, Tailwind 2 with JIT, Postcss 8, and some default setup
4 min readAug 5, 2021
It is always nice to follow a detailed guide and steps when building new rails apps. Below is a bit of guidance and step-by-step instructions.
Create a new project;
rails new project_name -d postgresql
Initial gem setup
Addition gems, which I mostly used in every project;
group :development do
gem 'meta_request', github: 'dejan/rails_panel', branch: 'master', glob: 'meta_request/meta_request.gemspec' gem 'pry-rails'
gem 'annotate'
gem 'letter_opener_web'
gem 'foreman'
end
gem 'devise'
gem 'acts_as_tenant'
gem 'friendly_id'
gem 'stripe'
Run:
bundle install
Add static pages
rails g controller pages home about contact#config/routes.rb
- get 'pages/home'
+ root to: 'pages#home'
Verify pages
rails db:prepare
rails s
Visit http://127.0.0.1:3000/ and you can see, below text
Pages#home
Find me in app/views/pages/home.html.erb
Upgrade Webpacker
# Gemfile
- gem 'webpacker', '~> 5.0'
- gem…