D john

Joined

2,040 Experience
20 Lessons Completed
0 Questions Solved

Activity

I have no idea why Pagy 9.3 does not render the widget properly on rails 7.0.8.6

Followed the instructions on pagy github repo for tailwind
The only way to get it to work is to downgrade pagy to "6.5"

Also if you are using HAML, it requires to use .html_safe to render the minimal widget on the page

  &= pagy_nav(@pagy).html_safe if @pagy

Can anyone tell me if using Cloudinary can be used as a better alternative to Amazon S3 for file uploads ?
Especially since Cloudinary seems to have Digital Assets Management commands that will work from Rails Apps ?

Posted in Rich Text Blog Posts with ActionText Discussion

If anyone using HAML, and having the problem where the content rich_text_field is of type="hidden"

This fixes it. (Thanks Patryk)

!!!
%html
  %head
    %meta{:content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type"}/
    %title BlogV1
    %meta{:content => "width=device-width,initial-scale=1", :name => "viewport"}/
    = csrf_meta_tags
    = csp_meta_tag
    = stylesheet_link_tag "tailwind", "data-turbo-track": "reload"
    = javascript_importmap_tags
  %script{type: "text/javascript", src: "https://unpkg.com/trix@2.0.0/dist/trix.umd.min.js"}
  %link{rel: "stylesheet", href: "https://unpkg.com/trix@2.0.0/dist/trix.css"}
    = stylesheet_link_tag "application", media: "all"
    = javascript_include_tag "application"
  %body.prose.mx-auto.border
    = render "layouts/flash"

Posted in Authenticating Blog Admin Pages Discussion

User.where(email: "me@mail.com").first_or_initialize seems to throw an error, - No such method in Active Record.
But
User.first_or_initialize_by(email: "me@mail.com") seems to work :)