I have a Rails form that has an observable field that executes an ajax request when the dropdown list changes. Ajax forces the form to re-display (the form is partial) with an additional parameter that causes the text on the page to change. All this works fine, but when I refresh the page (I start firefox), the text is reset, and the drop-down does not change its value. This way I get a selection value that does not match the dynamic text.
I tried to set the default value for the dropdown, but for some reason firefox will not change the value when the page is refreshed.
This is the code for the drop down list:
<%= select_tag :category, options_from_collection_for_select(@categories, :letter, :name, @letter) %>
@letter is installed dynamically and controls the dynamic text on the page.
This is the action that appears when the page is refreshed:
def new
@part = Part.new @letter = params[:letter] || "A" @part.cpn = Part.find_next_cpn(@letter) @categories = PartCategory.find(:all) respond_to do |format| format.js format.html end
end code>
I need a way to save dynamic text information or reset a drop down menu.
Audie source share