devise icon indicating copy to clipboard operation
devise copied to clipboard

Rails 7 + Devise + Tailwindcss

Open evertonlopesc opened this issue 3 years ago • 0 comments

Pre-check

  • Creating a new project without errors and with the stack below.

Environment

  • Ruby 3.1.0
  • Rails 7.0.1
  • Devise both {
    • gem 'devise', github: 'heartcombo/devise', branch: 'main'
    • gem 'devise' }
  • Tailwindcss 2

Current behavior

  • No error

Expected behavior

  • Happy

My Solution

  • Install rails without tailwindcss (e.g. rails new app_name -d=database)
  • Install devise gem

$ rails generate devise:install

  • Devise install:

$ rails generate devise:install

  • Added in config/initializers/devise.rb:

config.navigational_formats = ['/', :html, :turbo_stream]

  • User model create

$ rails generate devise "MODEL"

  • Add authentication and routes configuration etc.
  • Generate devise views and not user views

$ rails generate devise:views

  • Added tailwindcss

Install Tailwind CSS with Ruby on Rails

evertonlopesc avatar Feb 02 '22 01:02 evertonlopesc