Open MaximShaikovskiy opened 2 months ago
I'm not sure what could be happening, but it looks like your two network request screenshots are showing two different things -- the first on localhost shows the POST request to im_admissions (/admin/im_admissions
) which indicates the form submission, and correctly a POST.
The second on new.siil.ch shows the GET request to new
(presumably /admin/im_admissions/new
) which is the path to the form page itself, which I would expect to see as a GET request.
Is there a POST request showing on staging once you submit the form?
Screencast from 12.09.2024 15:45:48.webm Yes, this is very strange behavior, I recorded a video to show that I press the update button and a GET request is sent
Pausing the screencast at 0:15 I can see that there was a POST request, before it redirects to the show form action and does a GET request.
Having said that, there does appear to be something odd going on with the double navigation showing in the first few seconds of the video. Is this something you see across all of your admins or just this particular one? Would you be able to share some of your admin's form code?
authorization is done through gem 'trestle-auth', '0.5.0.pre' even if there is a post request on production.log only GET is processed
form do |im_admission|
text_field :title
text_field :subtitle
text_field :entry_title
text_area :entry_text
text_field :left_tag
text_field :right_tag
select :language, [:ru, :en, :fr]
row do
col(xs: 6) { image_tag(im_admission.image.url) if im_admission.image.present? }
col(xs: 6) { file_field :image }
col(xs: 6) { image_tag(im_admission.image_2x.url) if im_admission.image_2x.present? }
col(xs: 6) { file_field :image_2x }
end
end
I have now created another admin, the same thing happens under him
I apologize for thinking about your gem. It turned out that the problem was in nginx - POST /admin/im_admissions/1 HTTP/1.1" 413. I’m not a devops, it’s just a company saving money, so it took me a long time to find out what the reason was. Thank you for telling me to pause the video and see the request.
I'm glad you were able to find the solution, as I was running out of ideas. I am a little surprised that Trestle didn't show an error modal when the 413 status response was received so I will definitely investigate that further.
I'm trying to create an entity. Locally it works as it should, I launched a local production environment and it also works. On The stage server sends only GET at once. Same thing in 0.10.0pre. These are requests from the same form, one locally and the other from the server This is the form itself in the layout on the server, ideally it should send POST