Benjamin Deutscher

Joined

880 Experience
1 Lesson Completed
1 Question Solved

Activity

Hi,
I was able to solve my problem. I misconfigured my nginx. I pasted the wrong config snippet for static image delivery into the config. This is actually so embarrassing!

Thank you very much for your help.

Ben

Hi Chris,
thanks for your response! I might haven't made my problem clear enough. I do get the correct link to the image with my real domain. URL wise everything looks fine so far. It is just the link itself that is not working. Sorry for the inconvenience!

This is the output that is produced. MYDOMAIN is my actual domain.

<div class="trix-content">
  <div><action-text-attachment sgid="BAh7CEkiCGdpZAY6BkVUSSI1Z2lkOi8va3Voc2VpdGUvQWN0aXZlU3RvcmFnZTo6QmxvYi8zOT9leHBpcmVzX2luBjsAVEkiDHB1cnBvc2UGOwBUSSIPYXR0YWNoYWJsZQY7AFRJIg9leHBpcmVzX2F0BjsAVDA=--bafaf208e014e92662a15626e443eeeef2d677f0" content-type="image/png" url="http://MYDOMAIN/rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBMQT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--cd93111a807a97c12f5fb5d0fe1447d015ea0766/TryAndError.png" filename="TryAndError.png" filesize="1178020" width="1920" height="1080" previewable="true" presentation="gallery"><figure class="attachment attachment--preview attachment--png">
    <img src="http://MYDOMAIN/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBMQT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--cd93111a807a97c12f5fb5d0fe1447d015ea0766/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9VY21WemFYcGxYM1J2WDJ4cGJXbDBXd2RwQWdBRWFRSUFBdz09IiwiZXhwIjpudWxsLCJwdXIiOiJ2YXJpYXRpb24ifX0=--1bd348c8e1d1c843a4eda82746c8ac2d4f33faae/TryAndError.png">

  <figcaption class="attachment__caption">
      <span class="attachment__name">TryAndError.png</span>
      <span class="attachment__size">1.12 MB</span>
  </figcaption>
</figure></action-text-attachment></div>
</div>

Using the link from the src attribute of the img tag http://MYDOMAIN/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBMQT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--cd93111a807a97c12f5fb5d0fe1447d015ea0766/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9VY21WemFYcGxYM1J2WDJ4cGJXbDBXd2RwQWdBRWFRSUFBdz09IiwiZXhwIjpudWxsLCJwdXIiOiJ2YXJpYXRpb24ifX0=--1bd348c8e1d1c843a4eda82746c8ac2d4f33faae/TryAndError.png takes me to my 404 error page.

Hi,
I am desperatly trying to get my ActionText site working in production. I have a it working in development. In production the upload and editing is working fine, I get the images saved on local disk. But when showing the page I only get a broken image. Visiting the image url will result in an error 404.

The URL is something like example.com/rails/active_storage/representations/SIGNED_ID/myimage.jpeg.
Using rails c I get all attachments of the rich_text body. Is there a route I need to configure to get the images to show?

Edit
Some more information

  • I am running unicorn and nginx
  • ruby 2.6.5p114
  • rails 6.0.2.1

config/storage.yml

local:
  service: Disk
  root: <%= Rails.root.join("storage") %>

production.rb

 # Store uploaded files on the local file system (see config/storage.yml for options).
  config.active_storage.service = :local

routes.rb

Rails.application.routes.draw do
  resources :pages, param: :seo_url, path: 'seite'

  get '/index', to: 'application#home', as: :home
  root to: 'application#home'
end

Regards,
Ben

Posted in How to use Action Mailbox in Rails 6 Discussion

Alright, thanks for your responses! I will have a looking into Sendgrid and give it a try.

Ben

Posted in How to use Action Mailbox in Rails 6 Discussion

Hi,
I'm struggeling getting it right. I can follow the explanation and already have an application coded. The thing I don't really understand is: How does my mail server deliver the mails to my mailbox application? Is it really "just" a single command like state here: https://github.com/rails/rails/blob/6-0-stable/actionmailbox/app/controllers/action_mailbox/ingresses/relay/inbound_emails_controller.rb#L41-L44

Will this command be executed for every mail on it's own or is this something one can configure in the mailserver? I - sadly - have no experience with mail servers.

Kind regards,
Ben