jl@lejoly.com
Joined
Activity
not asking for an absolute solution, but just a hint to know in what direction to look, or what to exclude to see if it works
when I call my app via the link in the browser it comes with 'HPE_HEADER_OVERFLOW: Request could not be proxied'
the rails trace looks clean:
'Started GET "/d/users/sign_in" for 73.127.89.253 at 2022-03-23 21:52:51 +0000
Cannot render console from 73.127.89.253! Allowed networks: 127.0.0.0/127.255.255.255, ::1
Processing by Devise::SessionsController#new as HTML
Rendering layout layouts/application.html.erb
Rendering devise/sessions/new.html.erb within layouts/application
Rendered devise/shared/_links.html.erb (Duration: 1.3ms | Allocations: 526)
Rendered devise/sessions/new.html.erb within layouts/application (Duration: 470.4ms | Allocations: 412889)
Rendered layouts/_flash_messages_dro.html.erb (Duration: 0.3ms | Allocations: 154)
Rendered layouts/_header.html.erb (Duration: 3.3ms | Allocations: 2347)
Rendered layout layouts/application.html.erb (Duration: 700.8ms | Allocations: 652111)
Completed 200 OK in 736ms (Views: 705.6ms | ActiveRecord: 4.8ms | Allocations: 672243)'
For background: I am developing on AWS-Cloud9. The app ran great in 5.1, and also great on Rails6.0. Then I updated ruby to 3.1.1 and then rails to 6.1 and worked out the errors that would show in the logs. Now when I start the server as follows: with a run script: '
export PATH=/home/ubuntu/.rvm/gems/ruby-3.1.1/bin:/home/ubuntu/.rvm/gems/ruby-3.1.1@global/bin:/home/ubuntu/.rvm/rubies/ruby-3.1.1/bin:/home/ubuntu/.rvm/bin:/home/ubuntu/.nvm/versions/node/v6.17.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/ubuntu/.local/bin:/home/ubuntu/bin:/snap/bin
export GEM_HOME=/home/ubuntu/.rvm/gems/ruby-3.1.1
export GEM_PATH=/home/ubuntu/.rvm/gems/ruby-3.1.1:/home/ubuntu/.rvm/gems/ruby-3.1.1@global
cd /home/ubuntu/environment/twf
rails server -u puma -b localhost'
the server starts just fine, and when I call the link it does seem to start per rails log, and completes 200 OK but now I do get a browser message: 'HPE_HEADER_OVERFLOW: Request could not be proxied!
There was an error proxying the request.'
Does anybody have a hint for me on where to start looking. I googled it and found a page in Japanese from 2017 but that was for Phyton on cloud9 and not rails.
Any help is greatly appreciated.... even questions I would have to answer to get more background are all good.
SO I have created an rails application, that I want to distribute for a fee.
It will be hosted on AWS elastic servers with autoscale.
I need to somehow have the ability to generate liceses for my enduser customers for my application. I was thinking on something like number of concurrent users per customer, or named users per customer. The named users thing is fairly easy to do, but I feel the concurrent user model is more interesting and does better reflect the actual use of the product.
Are there any good out of the box Rails methods to handle this?
Hello, I am on Rails 5.2.3.
I just followed the rails guide on ActiveStorage, and have the attachments working. from a display, download link POV.
What I do not seem to get functioning is the delete of a single attachment via a link or button in my view. And then when the delete is done, i would it to refresh my view while staying on the same page.
Somehow with the code below, and likely the settings in my routes file, instead of going to delete_image it goes to destroy of the same controller, and of course can't do anything with what the parameter hands it.
I am not attached to the method chosen, as long as I can succeed in deleting the field from the view.
Any help is appreciated.
here is what I have in my view:
<% if @tr.image.attached? %>
<% @tr.image.each do |document| %>
<%= link_to document.blob.filename, url_for(document), target: :_blank %>
<%= image_tag url_for(document), size:100 %>
<%= link_to 'Download', document, download: document %>
<%= link_to 'Delete', delete_image_tr_path(document), method: :delete, data: { confirm: 'Are you sure?' }%>
<% end %>
<% end %>
in the controller I added :
def delete_image
@nowpath = params[:nowpath]
@image = ActiveStorage::Attachment.find(params[:id])
logger.debug "++++ in delete image --------------------" + @image.inspect + "---------------------"
@image.purge
redirect_to tr_path
end
and in my routes I have :
get '/tr/delete_image/:id', to: 'tr#delete_image', as: :delete_image_tr