Skip to content

sobanakram/rails-template

Repository files navigation

Rails 7 Template

Requirements

  1. Ruby 3.1.1
  2. Rails 7.0.2
  3. Postgres 14
  4. Node js and Yarn

Getting started

  1. Create repo by clicking on use this template.
  2. Clone new repo.
  3. Install bundler within gem install bundler.
  4. Install dependencies using bundler bundler install.
  5. Rename project using this command rails g rename:into New-Name
  6. Create Database and migrate rails db:create db:migrate
  7. Create Credentials file alongside master key file EDITOR="nano" rails credentials:edit
  8. Start Server bin/dev and visit http://localhost:3000
Adding gems

You should use pessimize to add the right version for new gems.

$ gem install pessimize

Then, when adding a new gem to the Gemfile:

$ bundle install
$ pessimize --no-backup
Model annotations

After adding new migration run this command to annotate models

$ annotate --models
Ruby Style Guide, Linter and fixed

We use Standard for Ruby Style Before committing code, you should run this command to see any issues

$ bundle exec standardrb

You can run this command to auto fix those issues

$ bundle exec standardrb --fix
Credentials

We are using Rails way to add critical credentials And for testing we are using Heroku and SERVER_URL ENV variable.

Releases

No releases published

Packages

No packages published

Languages