Patryk

Joined

6,950 Experience
69 Lessons Completed
0 Questions Solved

Activity

Posted in Rich Text Blog Posts with ActionText Discussion

To make that editor work in any way shape, or form I had to add following line to the head in the application.html.erb

<script type="text/javascript" src="https://unpkg.com/trix@2.0.0/dist/trix.umd.min.js"></script>

For those wondering why the popup didn't show up, you can add this at the top of index.html.erb:
<%= javascript_include_tag "turbo", type: "module" %>

At least that's how I solved it following previous tutorial 😇

Posted in Rails for Beginners Part 33: Twitter API Discussion

Thank you for this!

That will break the Connect Twitter button so you would also need to replace it with (as Alex Lutz noticed earlier):
<%= button_to "Connect Twitter", "/auth/twitter", method: :post, data: { turbo: "false" }, class: "btn btn-primary" %>

For all of us thing to find out why we won't get that popup confirmation,
try adding this at the beginning of index.html.erb:
<%= javascript_include_tag "turbo", type: "module" %>

and change the button code to this:
<%= button_to "Disconnect", twitter_account, method: :delete, data: { turbo_confirm: "Are you sure?" }, class: "btn btn-outline-danger" %>