-
-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ActiveStorage image url isn't correct on localhost #39
Comments
So I dug a bit into this. Surprisingly, even setting everything up in ActiveSupport::Reloader.to_prepare do
ApplicationController.renderer.defaults.merge!(
http_host: 'localhost',
https: false
)
end [1] pry(main)> ApplicationController.renderer
=> #<ActionController::Renderer:0x00007fc5a3b907d8
@controller=ApplicationController,
@defaults={:http_host=>"localhost", :https=>false, :method=>"get", :script_name=>"", :input=>""},
@env={"HTTP_HOST"=>"example.org", "HTTPS"=>"off", "REQUEST_METHOD"=>"GET", "SCRIPT_NAME"=>"", "rack.input"=>"", "rack.url_scheme"=>"http"}> As you can see it's present in So either I'm not understanding everything correctly (more likely) or this is a Rails bug. |
Interestingly, the rails code docs states:
so this should work? |
Thanks for taking a look into this. Apologies for not getting back to it. Been pretty tied up for the past week. |
So, apparently, thanks to @leastbad and @ParamagicDev on the StimulusReflex discord, setting
should do it. I suspected it had to be some of those config options, just it wasn't clear which Could you try this and confirm? Then I'd update the docs and close the issue... |
@StephenFiser could you take a look if #50 looks good to you? |
…host Add Gotcha hint to README #39
This might be interesting to you, @StephenFiser https://discordapp.com/channels/629472241427415060/733725826411135107/754809268917502084 |
@leastbad thanks for sharing! Totally fell off the wagon on this ticket 😬 Been swamped with unrelated items. |
Image src is prefixed with
http://example.org
instead ofhttp://localhost:3000
.The text was updated successfully, but these errors were encountered: