ruby - Rails: Resetting form fields with page refresh -


I have got a rail form in which there is a look_field, which makes an AJAX request when a drop down list changes. The reason for re-presenting AJAX form (form is in partial) with an extra absolute on the page is to change some text, all of them work fine, but when I refresh the page (I have Firefox I'm running), the text resets and the drop down list does not change its value. Thus, I end up with a selective value that does not correspond to dynamic text.

I tried to set a default selected value of the drop down, but for some reason the value will not change with Firefox, a page refresh.

This is the code for the dropdown in the view:

<% = select_tag: category, options_from_collection_for_select (@category, letter:: name, @ letter) %>

The @ page is dynamically set and controls the dynamic text on the page.

This is the action that is given on page refresh:

DIF New

  @part = Part.new @ left = Params [: letter] || "A" @ part.cpn = Part.Find_XCPCPN (@Letter) @ Segments = Particure.Find (: All) response_to do format | Format.js format.html end  

end

I need a way to maintain dynamic text information or to reset the drop down menu.

You have to set the 'autocomplete' option - it tells the browser that you are not field

Here's an example:

You can do the same thing, but automatically turn off completely for specific areas.

In other words, the form is not refreshing, because the browser is proving useful by putting the last data used by the customer, you need to stop trying to make the browser helpful. You are already providing the correct data.


Comments