Editor.js in Ruby on Rails 7 with Stimulus!

  Рет қаралды 6,371

Deanin

Deanin

Күн бұрын

Пікірлер: 15
@Deanin
@Deanin Жыл бұрын
Hey everyone! This one was actually pretty quick to put together, thanks to the docs and ChatGPT haha. If you're interested, I have Active Storage working with Editor.JS as well. It's pretty easy to integrate, I'd be happy to cover that as well. Let me know. Playlist for future videos: kzbin.info/aero/PL3mtAHT_eRexIV5-61ibrzBKap1TT2Q_y
@wakematta
@wakematta Жыл бұрын
the play list doesnt have the video :)
@Ninjujitsu
@Ninjujitsu Ай бұрын
downdooted for using chatgpt
@pawpenggaga
@pawpenggaga 9 ай бұрын
Bro is carrying the weight of the whole Rails framework in his shoulders ur an icon
@stpaquet
@stpaquet Жыл бұрын
Always happy to discover new JS libs
@SethCox-g7h
@SethCox-g7h Жыл бұрын
Thanks! This came at the perfect time. Can you share your solution to integrating active storage as well? MUCH appreciated!
@WilliamHouston-ct4eg
@WilliamHouston-ct4eg 6 ай бұрын
Great introduction and setup! One way that I was able to simplify the form submission is by tying the submit action of the form to a function on the stimulus controller. That gets rid of the event handling in `connect`. You can also skip the prevent default on the event if the rest of the form submission is "regular". The event is handled before the request is sent to the server, so the content is added properly. There might be some issue with using async/await in event handling, but I haven't seen any problems yet. Obviously, I used slightly different controller and function names: ``` // In the JS: async addEditorContent() { const data = await this.contentEditor.save() this.contentInputTarget.value = JSON.stringify(data) } // On the form in the html: data-action='editorjs#addEditorContent' ```
@chrise86
@chrise86 11 ай бұрын
Just a note on the event listeners - passing `this.saveEditorData.bind(this)` into the callback will cause a memory leak as it creates a new function every time. It would be better to use a fat arrow syntax for the method (i.e. `saveEditorData = async (event) => {}`, or bind in an initialize function (i.e. `this.saveEditorData = this.saveEditorData.bind(this)`.
@danielb.2873
@danielb.2873 4 ай бұрын
How to migrate from ActionText to EditorJS? Keeping the already written rich texts or translating them to EditorJS
@cporrast
@cporrast Жыл бұрын
Nice I've been trying to figure out what wysiwyg editor to use for a fun project
@kaihuang7158
@kaihuang7158 10 ай бұрын
good job bro
@umairhameed4594
@umairhameed4594 Жыл бұрын
Hey Deanin, how we add the fixed title block at the top in editorjs in rails?
@azizdevfull
@azizdevfull Жыл бұрын
Thanks!
@danielb.2873
@danielb.2873 4 ай бұрын
Can I use EditorJS with Tailwindcss?
@wintanmi
@wintanmi Жыл бұрын
Great content here @Deanin...but I am having an issue, I have done everything and checked with your code..but i get this persistent error at my end. JSON::ParserError in Articles#index Showing /home/wintan/railsproject/winread/app/views/articles/_article.html.erb where line #9 raised: 859: unexpected token at '' Extracted source (around line #3): 1 2 3 4 5 6 module ArticlesHelper def display_content(content) parsed_content = JSON.parse(content) content_html = parsed_content['blocks'].map do |block| case block['type'] when 'paragraph' this has really delayed me for weeks now...I would be glad if you can help me please.
UFC 310 : Рахмонов VS Мачадо Гэрри
05:00
Setanta Sports UFC
Рет қаралды 1,2 МЛН
My scorpion was taken away from me 😢
00:55
TyphoonFast 5
Рет қаралды 2,4 МЛН
Гениальное изобретение из обычного стаканчика!
00:31
Лютая физика | Олимпиадная физика
Рет қаралды 4,6 МЛН
Reactive Stimulus Values in Ruby on Rails 7
10:15
Deanin
Рет қаралды 6 М.
All Rust string types explained
22:13
Let's Get Rusty
Рет қаралды 188 М.
Let's Build a Dockerfile for Your Rails Apps From Scratch
1:06:58
Vim Tips I Wish I Knew Earlier
23:00
Sebastian Daschner
Рет қаралды 82 М.
Rewriting Raylib in JavaScript
2:12:47
Tsoding Daily
Рет қаралды 28 М.
Where Does Bad Code Come From?
42:21
Molly Rocket
Рет қаралды 204 М.
Cursor + Windsurf Settings to 5x AI's Output Quality (Works with VS Code too)
13:53
Intro To View Components In Ruby On Rails 7
35:27
Deanin
Рет қаралды 8 М.
I tried React and it Ruined My Life
1:19:10
Tsoding Daily
Рет қаралды 155 М.
UFC 310 : Рахмонов VS Мачадо Гэрри
05:00
Setanta Sports UFC
Рет қаралды 1,2 МЛН