简体   繁体   中英

How to fix Action Text in Rails 6 where rich_text_area is empty on the page?

Guys I am trying to use Action Text with the rich_text_area tag. But on the page view the description field is Empty.

Here the package.json:

{
      ...
        "@rails/actiontext": "^6.0.3-1",
        ...
      },
      }
}

Gemfile.lock:

GEM
  remote: https://rubygems.org/
  specs:
      ...
    actionpack (6.0.3.1)
     ...
      rails-html-sanitizer (~> 1.0, >= 1.2.0)
    actiontext (6.0.3.1)

Yarn.lock:

"@rails/actiontext@^6.0.3-1":
  version "6.0.3-1"
  resolved "https://registry.yarnpkg.com/@rails/actiontext/-/actiontext-6.0.3-1.tgz#3ad0072774a243c26a21637d0cdb29ca3b5f49b5"
  integrity sha512-niwfhqefg9AwQhIg1L2mqGNAYB7z1MVSZL6yMKmJFv9/sH3HXTxrnVzBHFdOIak3/XFk3bRVZN5kRMZWyOOwzg==
  dependencies:
    "@rails/activestorage" "^6.0.0-alpha"

_step3.html.erb:

<div class="step-content <%= 'is-active' if @step == 3 %>">
    <div class="field">
        <label for="" class="label">Description</label>
        <%= f.rich_text_area :description, rows: 50, cols: 50 %>
    </div>
</div>

Here is the class model:

class Gig < ApplicationRecord
 ...
  has_many_attached :photos
  has_rich_text :description

  ...
end

Description is empty: 在此处输入图像描述

Should be like this: 在此处输入图像描述

it's working after re installation with command and the manual action text installation :

bin/rails action_text:install

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM