form not loading for get request

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

form not loading for get request

fugee ohu
This request has some utf8 in between "item_type_id" and "="
GET /items/new?utf8=%E2%9C%93&item%5Bitem_type_id%5D=9&commit=New+item HTTP/1.1

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/4e4ee2a6-e656-4dd2-84f0-670f9eaa40b0%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: form not loading for get request

Ariel Juodziukynas
It's normal that rails adds a hidden field with the name `utf8` and a check as the value, when you submit a form using GET the hidden field goes there with the other fields, there's nothing wrong there.

You should have some error on the console if something is not working, that `utf8` parameter is ok.

El sáb., 30 nov. 2019 a las 20:28, fugee ohu (<[hidden email]>) escribió:
This request has some utf8 in between "item_type_id" and "="
GET /items/new?utf8=%E2%9C%93&item%5Bitem_type_id%5D=9&commit=New+item HTTP/1.1

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/4e4ee2a6-e656-4dd2-84f0-670f9eaa40b0%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAPS3bcBFxS92d6-28qdRmXg%3DQDR_vVA7-pzFFw5Ux7Uf3x6KjQ%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: form not loading for get request

fugee ohu


On Saturday, November 30, 2019 at 8:07:43 PM UTC-5, Ariel Juodziukynas wrote:
It's normal that rails adds a hidden field with the name `utf8` and a check as the value, when you submit a form using GET the hidden field goes there with the other fields, there's nothing wrong there.

You should have some error on the console if something is not working, that `utf8` parameter is ok.

El sáb., 30 nov. 2019 a las 20:28, fugee ohu (<<a href="javascript:" target="_blank" gdf-obfuscated-mailto="5ZuUWHh-AQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">fuge...@...>) escribió:
This request has some utf8 in between "item_type_id" and "="
GET /items/new?utf8=%E2%9C%93&item%5Bitem_type_id%5D=9&commit=New+item HTTP/1.1

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="5ZuUWHh-AQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">rubyonra...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/rubyonrails-talk/4e4ee2a6-e656-4dd2-84f0-670f9eaa40b0%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/4e4ee2a6-e656-4dd2-84f0-670f9eaa40b0%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/4e4ee2a6-e656-4dd2-84f0-670f9eaa40b0%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/rubyonrails-talk/4e4ee2a6-e656-4dd2-84f0-670f9eaa40b0%40googlegroups.com.

That's the last thing in the console Here's my form:

<%= form_with(model: @item, url: new_item_path(@item), method: "get") do |f| %>

     <div class="field">
         <%= f.select :item_type_id, nested_set_options(ItemType.all, @item_type) {|i| "#{'-' * i.level} #{i.name}" }, {:include_blank => "Select"}%>
     </div>

    <div class="actions">
        <%= f.submit "New item" %>
    </div>

<% end %>

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/5fd17013-9f43-41c9-8580-0f5009fd3f33%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: form not loading for get request

fugee ohu
In reply to this post by Ariel Juodziukynas
 I guess I'd better explain the form I just posted is from the index view and on submit it's supposed to launch the new action and load the next form

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/a4caf763-b02f-4d25-980d-a55310a55fa1%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: form not loading for get request

Ariel Juodziukynas
The form looks ok, the parameters on the request too, it's impossible to tell you something else if you have nothing on the logs (rails and the browser's network tab) that could indicate an error

El sáb., 30 nov. 2019 a las 22:37, fugee ohu (<[hidden email]>) escribió:
 I guess I'd better explain the form I just posted is from the index view and on submit it's supposed to launch the new action and load the next form

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/a4caf763-b02f-4d25-980d-a55310a55fa1%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAPS3bcAFq6bYGXXg8aBx--CE_meVq5vwB24pgq1QXyJwrK5-nA%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: form not loading for get request

fugee ohu


On Saturday, November 30, 2019 at 9:01:50 PM UTC-5, Ariel Juodziukynas wrote:
The form looks ok, the parameters on the request too, it's impossible to tell you something else if you have nothing on the logs (rails and the browser's network tab) that could indicate an error

El sáb., 30 nov. 2019 a las 22:37, fugee ohu (<<a href="javascript:" target="_blank" gdf-obfuscated-mailto="nCJXXWyBAQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">fuge...@...>) escribió:
 I guess I'd better explain the form I just posted is from the index view and on submit it's supposed to launch the new action and load the next form

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="nCJXXWyBAQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">rubyonra...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/rubyonrails-talk/a4caf763-b02f-4d25-980d-a55310a55fa1%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/a4caf763-b02f-4d25-980d-a55310a55fa1%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/a4caf763-b02f-4d25-980d-a55310a55fa1%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/rubyonrails-talk/a4caf763-b02f-4d25-980d-a55310a55fa1%40googlegroups.com.

new.html.erb only has <%= render 'form' %> maybe I should be passing some parameters to render 'form' ?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/f0f6582e-50ab-4edd-895b-536e8b0e5527%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: form not loading for get request

fugee ohu
In reply to this post by Ariel Juodziukynas


On Saturday, November 30, 2019 at 9:01:50 PM UTC-5, Ariel Juodziukynas wrote:
The form looks ok, the parameters on the request too, it's impossible to tell you something else if you have nothing on the logs (rails and the browser's network tab) that could indicate an error

El sáb., 30 nov. 2019 a las 22:37, fugee ohu (<<a href="javascript:" target="_blank" gdf-obfuscated-mailto="nCJXXWyBAQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">fuge...@...>) escribió:
 I guess I'd better explain the form I just posted is from the index view and on submit it's supposed to launch the new action and load the next form

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="nCJXXWyBAQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">rubyonra...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/rubyonrails-talk/a4caf763-b02f-4d25-980d-a55310a55fa1%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/a4caf763-b02f-4d25-980d-a55310a55fa1%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/a4caf763-b02f-4d25-980d-a55310a55fa1%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/rubyonrails-talk/a4caf763-b02f-4d25-980d-a55310a55fa1%40googlegroups.com.

It gets a 500 response
127.0.0.1 - - [01/Dec/2019:08:25:49 EST] "GET /items/new?utf8=%E2%9C%93&item%5Bitem_type_id%5D=1&commit=New+item HTTP/1.1" 500 0
http://localhost:3000/items -> /items/new?utf8=%E2%9C%93&item%5Bitem_type_id%5D=1&commit=New+item
How do I find the error?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/77108a16-3395-4562-aabd-dbd77d8f80ee%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: form not loading for get request

Ariel Juodziukynas
What's your log level value? make sure it's "debug" on your environment https://guides.rubyonrails.org/debugging_rails_applications.html#log-levels

El dom., 1 dic. 2019 a las 10:30, fugee ohu (<[hidden email]>) escribió:


On Saturday, November 30, 2019 at 9:01:50 PM UTC-5, Ariel Juodziukynas wrote:
The form looks ok, the parameters on the request too, it's impossible to tell you something else if you have nothing on the logs (rails and the browser's network tab) that could indicate an error

El sáb., 30 nov. 2019 a las 22:37, fugee ohu (<[hidden email]>) escribió:
 I guess I'd better explain the form I just posted is from the index view and on submit it's supposed to launch the new action and load the next form

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/a4caf763-b02f-4d25-980d-a55310a55fa1%40googlegroups.com.

It gets a 500 response
127.0.0.1 - - [01/Dec/2019:08:25:49 EST] "GET /items/new?utf8=%E2%9C%93&item%5Bitem_type_id%5D=1&commit=New+item HTTP/1.1" 500 0
http://localhost:3000/items -> /items/new?utf8=%E2%9C%93&item%5Bitem_type_id%5D=1&commit=New+item
How do I find the error?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/77108a16-3395-4562-aabd-dbd77d8f80ee%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAPS3bcDi802tvaQeJ86XBxawDVCxPKeTxtP5iyT-xznKxSWrPA%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: form not loading for get request

fugee ohu


On Sunday, December 1, 2019 at 9:13:53 AM UTC-5, Ariel Juodziukynas wrote:
What's your log level value? make sure it's "debug" on your environment <a href="https://guides.rubyonrails.org/debugging_rails_applications.html#log-levels" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fguides.rubyonrails.org%2Fdebugging_rails_applications.html%23log-levels\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH-XC5C-dHGvIQO3RbiXZZWueqnKg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fguides.rubyonrails.org%2Fdebugging_rails_applications.html%23log-levels\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH-XC5C-dHGvIQO3RbiXZZWueqnKg&#39;;return true;">https://guides.rubyonrails.org/debugging_rails_applications.html#log-levels

El dom., 1 dic. 2019 a las 10:30, fugee ohu (<<a href="javascript:" target="_blank" gdf-obfuscated-mailto="ax4eGF-pAQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">fuge...@...>) escribió:


On Saturday, November 30, 2019 at 9:01:50 PM UTC-5, Ariel Juodziukynas wrote:
The form looks ok, the parameters on the request too, it's impossible to tell you something else if you have nothing on the logs (rails and the browser's network tab) that could indicate an error

El sáb., 30 nov. 2019 a las 22:37, fugee ohu (<[hidden email]>) escribió:
 I guess I'd better explain the form I just posted is from the index view and on submit it's supposed to launch the new action and load the next form

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/rubyonrails-talk/a4caf763-b02f-4d25-980d-a55310a55fa1%40googlegroups.com?utm_medium=email&amp;utm_source=footer" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/a4caf763-b02f-4d25-980d-a55310a55fa1%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/a4caf763-b02f-4d25-980d-a55310a55fa1%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/rubyonrails-talk/a4caf763-b02f-4d25-980d-a55310a55fa1%40googlegroups.com.

It gets a 500 response
127.0.0.1 - - [01/Dec/2019:08:25:49 EST] "GET /items/new?utf8=%E2%9C%93&item%5Bitem_type_id%5D=1&commit=New+item HTTP/1.1" 500 0
<a href="http://localhost:3000/items" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Flocalhost%3A3000%2Fitems\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH0FFdxqQn8KbR_pP67R1Qe7lzwvA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Flocalhost%3A3000%2Fitems\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH0FFdxqQn8KbR_pP67R1Qe7lzwvA&#39;;return true;">http://localhost:3000/items -> /items/new?utf8=%E2%9C%93&item%5Bitem_type_id%5D=1&commit=New+item
How do I find the error?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="ax4eGF-pAQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">rubyonra...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/rubyonrails-talk/77108a16-3395-4562-aabd-dbd77d8f80ee%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/77108a16-3395-4562-aabd-dbd77d8f80ee%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/77108a16-3395-4562-aabd-dbd77d8f80ee%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/rubyonrails-talk/77108a16-3395-4562-aabd-dbd77d8f80ee%40googlegroups.com.

Now I get 200 response and the log says it rendered items/_form.html.erb but the order of operations looks backwards First it renders the form then there's the get request to the new action Shouldn't the get request to the new action come first?

Started GET "/items/new?utf8=%E2%9C%93&item%5Bitem_type_id%5D=1&commit=New+item" for 127.0.0.1 at 2019-12-01 09:56:33 -0500
Processing by ItemsController#new as JS
  Parameters: {"utf8"=>"✓", "item"=>{"item_type_id"=>"1"}, "commit"=>"New item"}
  ItemProperty Load (0.7ms)  SELECT `item_properties`.* FROM `item_properties` WHERE (item_type_id='1')
  Rendering items/new.html.erb within layouts/application
  ItemType Load (0.7ms)  SELECT  `item_types`.* FROM `item_types` WHERE `item_types`.`id` = 1 LIMIT 1
  Rendered items/_form.html.erb (9.2ms)
  Rendered items/new.html.erb within layouts/application (13.9ms)
Completed 200 OK in 48ms (Views: 39.8ms | ActiveRecord: 1.4ms)


127.0.0.1 - - [01/Dec/2019:09:56:33 EST] "GET /items/new?utf8=%E2%9C%93&item%5Bitem_type_id%5D=1&commit=New+item HTTP/1.1" 200 1749
http://localhost:3000/items -> /items/new?utf8=%E2%9C%93&item%5Bitem_type_id%5D=1&commit=New+item


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/82820e51-ab3b-4e5e-9664-539551449d7b%40googlegroups.com.