Ruby on Rails 6 is the latest version of Ruby on Rails, "an open-source web framework that's optimized for programmer happiness and sustainable productivity."
Questions tagged [ruby-on-rails-6]
2084 questions
12
votes
3 answers
Rails 6 ActionText isn't working on Heroku (undefined method 'rich_text_area_tag')
I am using ActionText to edit a paragraph and it works perfectly locally but when I deploy it to Heroku the page which has the form with rich_text_area it throws an error saying undefined method rich_text_area_tag even though I followed the rails…

Grofen
- 153
- 8
11
votes
2 answers
Rails 6 Zeitwerk "DEPRECATION WARNING: Initialization autoloaded the constants..." but I can't figure out where?
I swear I've read the docs and I think I have a basic understanding of the principles, but I can't for the life of me figure out where I'm loading these constants inappropriately.
I'm working to upgrade an app that was originally Rails 5.2
I'm…

Chiperific
- 4,428
- 3
- 21
- 41
11
votes
3 answers
Rails 6.0.2.1 - “sameSite” attribute set to “none” “secure” attribute
Firefox error:
Cookie “_myapp_session” will be soon rejected because it has the
“sameSite” attribute set to “none” or an invalid value, without the
“secure” attribute. To know more about the “sameSite“ attribute,…

user2012677
- 5,465
- 6
- 51
- 113
11
votes
1 answer
Rails encrypted credentials with Heroku staging environment (using production setting)
Heroku recommends not using a custom environment called staging; instead, they suggest using the production environment but with a different set of ENV variables. This makes sense (see this question).
However, I am wondering how I can integrate…

thornomad
- 6,707
- 10
- 53
- 78
11
votes
1 answer
Can I generate a new config/master.key file?
My initial commit which I did on my workstation, ignored my config/master.key file. Now that I'm hundreds of miles away from my workstation, is there any way to generate a new master.key file using a cloned repo on my laptop?
Because I need it…

Maxxx
- 363
- 1
- 6
- 15
11
votes
3 answers
Is / why is Rails 6 still using / recommending CoffeeScript?
I am new to the Rails word. Using Rails 6 and following the guides / tutorials. On the official Rails guides, there are CoffeeScript examples and it's even recommended to use CoffeeScript, see:…

vvo
- 2,653
- 23
- 30
11
votes
4 answers
Remove ActiveStorage routes from Rails 6
I removed ActionStorage from config/application.rb yet I see these routes when I run rake routes | less.
I have nothing set up on my /config/routes.rb...
Prefix Verb URI Pattern …

Pants
- 2,563
- 1
- 20
- 34
11
votes
2 answers
How to use custom fonts in Rails 6 with Webpack
For my newly started Rails 6 application I want to have a set of customs fonts. My setup looks like this:
# app/assets/stylesheets/my-font.sass
@font-face
font-family: 'my-font'
src: url('fonts/my-font.eot') format('embedded-opentype'),…

Severin
- 8,508
- 14
- 68
- 117
11
votes
3 answers
How to test ActionText using RSpec?
I am trying to write an RSpec system test that involves filling out an ActionText / Trix field on a page.
It seems as though ActionText::SystemTestHelper as defined here is available to help with this task but so far I have not had any success in…

mdh
- 418
- 5
- 16
11
votes
3 answers
When using activestorage in Rails 6, how do I retain a file when redisplaying a form?
In Rails 6 I have a form with a file field and I am using activestorage to store the file. If validations fail after submitting the form, the form is redisplayed showing the validation errors. How can I retain the file added to the file field when…

Robban
- 1,191
- 2
- 13
- 25
10
votes
4 answers
How to deal with merge conflicts in rails ENCRYPTED credential files
With rails 6 (or 5.2) encrypted credentials, I am running into difficulty managing and resolving merge conflicts in the credentials.yml.enc file. As is outlined in the documentation, the intention is that encrypted credentials can be added to source…

cash22
- 430
- 3
- 20
10
votes
2 answers
Getting Jquery and Bootstrap to work with Rails 6
I am a new to rails and struggling to get Jquery and Bootstrap to work with Rails 6. I think it has something to do with switching the app from rails 5 to rails 6 and using webpacker to load Jquery rather than loading it as a gem. I have gone…

Tomas
- 318
- 3
- 11
10
votes
1 answer
Rails 6 local server booting : RAILS_ENV=development environment is not defined
I just created a new Rails 6 app. Everything went fine until I tried to launch the local server with rails s, and got this error message :
RAILS_ENV=development environment is not defined in config/webpacker.yml, falling back to production…

Ruff9
- 1,163
- 15
- 34
10
votes
3 answers
Converting back to plain text when using ActionText
First let me say that I love what Rails 6 has to offer in ActionText. Unfortunately when I declare it for an attribute in something like a post model:
class Post < ApplicationRecord
has_rich_text :body
end
I can't access the body's text anymore.…

Carl Edwards
- 13,826
- 11
- 57
- 119
10
votes
4 answers
The asset "application.js" is not present in the asset pipeline in Rails 6
I am creating a RoR-6 app and I get the following error thrown from application.html.erb file from this line:
javascript_include_tag 'application', 'data-turbolinks-track': 'reload'
I get the following error:
ActionView::Template::Error: The asset…

Steveo00
- 111
- 1
- 6