Questions tagged [actiontext]

148 questions
1
vote
0 answers

Rails - Trix - Add HR - insertAttachment not a function

I am trying to add a horizontal line option to the Trix editor in Rails 6.1.4. The example that I am finding for this (https://codepen.io/javan/pen/oQpevW) works perfectly, as long as it runs in CodePen. When I implement the example I am getting…
Edward Caulfield
  • 448
  • 5
  • 12
1
vote
0 answers

How to render action text as plain text including attachment content

I have a simple 'Character' model with a rich text field, description. In this field you can 'tag' other characters by inserting an attachment relevant to them. (Followed this tutorial: https://gorails.com/episodes/at-mentions-with-actiontext). When…
JesseWelch92
  • 109
  • 10
1
vote
1 answer

Paste rich text as plain text without HTML markup formatting in Trix editor

I am using Rich Text (Trix editor) with Rails and I want to be able to convert everything that user pastes to sanitized plain text instead of having formatted elements. Based on Trix documentation I am using this code to convert pasted elements to…
1
vote
1 answer

ActionText append string to body (in model or job)

class User << ApplicatinRecord has_rich_text :journal def receive_sms(sms_body) journal.update(body: journal.body + sms_body end end this function to append a message to the end of the ActionText is not working... something about how…
Blair Anderson
  • 19,463
  • 8
  • 77
  • 114
1
vote
0 answers

ActionController::RoutingError (No route matches [GET] "/assets/@rails/actiontext"):

I upgraded my app from 6.1 to rails 7. I removed webpack from the project. actiontext/trix isn't working locally or in production. all I get is a white box that i can't even insert text into. pretty sure i followed all the instructions correctly but…
1
vote
1 answer

Link "data-turbo-frame" attribute removed when rendering

I'm using Stimulus and ActionText to handle 'mentions', following the tutorial below; User @mentions with ActionText When displaying the actiontext content, the partial for each 'mention' is rendered from a json.builder file. The issue that I'm…
1
vote
1 answer

How to have multiple, separate, instances of Trix / ActionText rich text areas on the same page?

I have a list of commentable models in my Rails view, represented by cards that each have their own comment form. The forms are identical (from the same partial), and have a rich_text_area for the commentable's body (defined as has_rich_text :body…
aidan
  • 1,627
  • 17
  • 27
1
vote
0 answers

Anyone know why actiontext rich_text_area would render as an empty box in Rails 6?

I have reinstalled webpacker and action_text...all I get rendered in my form is a blank box. Please help!
Vince
  • 11
  • 1
1
vote
1 answer

Rails: ActionText has_rich_text returns nil

I've added ActionText into my Rails 5.2 app, according to this tutorial. I performed installation, migration and added action_text_rich_texts column. I also updated my model: class LiveEvent < ApplicationRecord has_rich_text :description_long end…
1
vote
1 answer

Rails 6 ActionText Error undefined method `body' for "":String

I get the following error when I try viewing the posts form on the browser on Rails 6. I have a admin/posts_controller.rb. The posts have a title and a body and I would like to add actiontext using trix editor on the body NoMethodError at…
noooooob
  • 211
  • 2
  • 7
1
vote
1 answer

Avoiding N+1 Queries on Actiontext::RichText of an included table

My data is set up like this: a Chat has_many messages a Message has_rich_text :detail_html Anyhow, I am trying to do a query that returns all the Chats. That query looks something like this: Chat.all.includes(:messages) However, because of…
Steez
  • 219
  • 5
  • 17
1
vote
3 answers

How to truncate ActionText output without trix formatting info

I have a Rails Action Text field :content and it renders fine if I accept the entire field but it's long and I just want to display a part of it. <%= year.content %> works fine except it's too long. <%= year.content.truncate(70) %> results in…
Greg
  • 2,359
  • 5
  • 22
  • 35
1
vote
1 answer

Action Text displaying html tags

I'm using Action Text in order to create articles and display well the content of it. But I have a problem, when I create my article then display the content it's showing the HTML tags. Here : Here is my code : articles/show.html.erb : <%=…
gclement
  • 83
  • 9
1
vote
2 answers

Action-text-attachment tag not displaying on React front end

I created a rails 6 Blog application using Action Text/Active Storage, the image loads fine on the rails server. But when i am using the api call to fetch the json and using the dangerouslySetInnerHtml afterwards in react to convert raw html, it is…
1
vote
1 answer

Use ActionText to create emails: Replace the placeholders like #LASTNAME with actual values from DB

I'm using rails ActionText to create emails for training invitations for all participants. These emails contain a custom attachment with reference to the training (like date / time of training, etc), but also some sort of salutation, like Dear…
fydelio
  • 932
  • 1
  • 8
  • 22