trix

Is there a proper way to wire up Trix editor with Livewire?

◇◆丶佛笑我妖孽 提交于 2021-02-18 17:10:54
问题 When wiring together Trix editor content with Livewire, I am stumbling into problems. I believe that the issue is that when Livewire receives content from Trix, the content is swapped out and Trix becomes disabled. Is there a better way? What I have done, that works, is as follows. At the moment, the page is the redirected to itself in order to reboot Trix (defeating the whole point of Livewire, but it's being used for other things too). <div> <input id="newCommentTextTrixContent" type=

Trix using rails actiontext add pure html

依然范特西╮ 提交于 2021-02-10 22:17:34
问题 I would like to use the rich text editor trix in rails6. How can I add a button to trix which adds html content? 回答1: To allow ActionText showing raw HTML, try this. <%= raw your_action_text_object.to_plain_text %> btw, I don't know why you want to add a button, could you explain in detail? 来源: https://stackoverflow.com/questions/62858681/trix-using-rails-actiontext-add-pure-html

Trix using rails actiontext add pure html

妖精的绣舞 提交于 2021-02-10 22:17:18
问题 I would like to use the rich text editor trix in rails6. How can I add a button to trix which adds html content? 回答1: To allow ActionText showing raw HTML, try this. <%= raw your_action_text_object.to_plain_text %> btw, I don't know why you want to add a button, could you explain in detail? 来源: https://stackoverflow.com/questions/62858681/trix-using-rails-actiontext-add-pure-html

Trix editor validation

一曲冷凌霜 提交于 2021-02-08 09:10:40
问题 Using Trix editor via Rails view helpers. = form.rich_text_area :description, class: 'form-control', placeholder: 'Description' Have some model 'required' validation for description. The normal Rails behavior of wrapping fields with field_with_errors is not happening. Has anyone managed to get Trix and the normal Rails validation behavior to work together? 回答1: Ended up fixing this way.. - if job.errors[:description].count > 0 .form-with-errors = form.rich_text_area :description, class: 'form

How to display embed video with ActionText

我只是一个虾纸丫 提交于 2020-07-17 10:28:32
问题 I am trying to display embedded videos with ActionText on Rails 6, both in the WYSIWYG Trix, and in the rendered content. But the ActionText renderer filters all raw html code and forces me to use JS to display the iframes in the rendered content, which doesnt work in Trix. I followed the instructions given here by one of Basecamp's dev : https://github.com/rails/actiontext/issues/37#issuecomment-451627370. Step 1 through 3 work, but when ActionText renders my partial it filters the iframe.

How to display embed video with ActionText

非 Y 不嫁゛ 提交于 2020-07-17 10:28:28
问题 I am trying to display embedded videos with ActionText on Rails 6, both in the WYSIWYG Trix, and in the rendered content. But the ActionText renderer filters all raw html code and forces me to use JS to display the iframes in the rendered content, which doesnt work in Trix. I followed the instructions given here by one of Basecamp's dev : https://github.com/rails/actiontext/issues/37#issuecomment-451627370. Step 1 through 3 work, but when ActionText renders my partial it filters the iframe.

Can't render youtube embed iframe with rails 6 actiontext

好久不见. 提交于 2020-07-09 13:24:39
问题 I have setup a custom embed model so I can add things like instagram or youtube embeds to actiontext content on my site. It's working correctly for instagram embeds, but not youtube. As a reference, the youtube embed code I want to display is: <iframe width="560" height="315" src="https://www.youtube.com/embed/F0kgw25zjpc" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> models/recipe.rb: class Recipe < ApplicationRecord

How to implement Action Text in Rails 5.2.1?

半城伤御伤魂 提交于 2020-06-29 03:45:28
问题 I'm experiencing difficulties in implementing the Action Text gem to my Rails 5.2.1 application. I followed the installation guide and the rich text editor wouldn't show up in my _form view. I then realised that it requires Rails 6 with webpacker and active storage . Changing my gemfile's Rails version and running rails upgrade didn't work, so I added the webpacker and active storage gems and bundled it with my current 5.2.1 version. That didn't work either. I'd really like to have a Rich

I can't get Trix Editor to show properly in Bootstrap theme

泪湿孤枕 提交于 2020-05-17 07:15:06
问题 I am trying to setup ActionText for the first time on my Article model. This is how my Article model looks: class Article < ApplicationRecord has_rich_text :body end I set up ActionText like so: rails action_text:install My app/javascript/packs/application.js looks like this: // This file is automatically compiled by Webpack, along with any other files // present in this directory. You're encouraged to place your actual application logic in // a relevant structure within app/javascript and

How do I integrate trix-editor in an angular 2 app?

大憨熊 提交于 2020-01-24 04:28:08
问题 I am trying to use trix editor for my angular app. However, I am not getting any resources/npm packages to install trix editor in an angular 2 app. Can you help me with the resources/steps to do so? 回答1: I also can not find any for angular2+. Just set it up. angular.json add below "styles": [ "node_modules/trix/dist/trix.css" ], "scripts": [ "node_modules/trix/dist/trix.js" ] attach editor at HTML you want to put it. angular using as selector and trix using as target location of editor. It