2

Trying to isolate an error I'm getting with the basic setup of a new blog site using the below just so I can test Action_Text for the create blog section.

Every-time i create the below- it works great until i change the <%= form.text_area :content %> to <%= form.rich_text_area :content %> then the text area vanishes????

package.json

{
  "name": "app",
  "private": "true",
  "dependencies": {
    "@hotwired/stimulus": "^3.1.0",
    "@hotwired/turbo-rails": "^7.1.3",
    "@popperjs/core": "^2.11.5",
    "@rails/actiontext": "^7.0.3-1",
    "bootstrap": "^5.2.0",
    "bootstrap-icons": "^1.9.1",
    "esbuild": "^0.14.54",
    "sass": "^1.54.3",
    "trix": "^2.0.0-beta.0"
  },
  "scripts": {
    "build": "esbuild app/javascript/*.* --bundle --sourcemap --outdir=app/assets/builds --public-path=assets",
    "build:css": "sass ./app/assets/stylesheets/application.bootstrap.scss:./app/assets/builds/application.css --no-source-map --load-path=node_modules"
  }
}
rvm gemset create project

rails new project --css bootstrap

rails g scaffold blog title:string content:text
Rails db:migrate
Rails action_text:install
Rails db:migrate
class Blog < ApplicationRecord
    validates_presence_of :title
    has_rich_text :content
end
<%= form.rich_text_area :content %>

I have searched for days online, tested, broken this multiple times and still cant find a solution.

Any assistance would be great. Thank you

Karl
  • 21
  • 3
  • 2
    I've tried every step you provided several times and noticed that if you run app with `rails s` rich_text_area indeed vanishes, try to run `bin/dev` instead and your app should work properly – steimo Aug 10 '22 at 10:22
  • 1
    Thank you @steimo running bin/dev was the answer – Karl Aug 24 '22 at 05:19
  • do we know why does this happen? – wachichornia May 23 '23 at 13:30
  • Sorry for the delay, @wachichornia [Ahmed Ali's](https://stackoverflow.com/a/31102981/17913437) response covers the dif between `rails s` and `bin/dev` – Karl Jun 13 '23 at 13:23

0 Answers0