When user selects one of the values, an the page is being submitted and html table change its contents. Unfortunately after a form submit, select tag returns to its initial value, but i want it to display the value user has chosen before submit. Thank you.
I think, I’ve found the solution - I added fourth arg to options_from_collection_for_select which is taken from the request params. Not sure if it is the right way, but it’s working:
One thing I’ve experienced with Rails is that you can’t have forms overlap each other. For example if you have a bunch of rows with check boxes to select each row item… if that is implemented as a form, then you can’t have another form in it. I think that has to do with Rails deciphering which form is which. One solution is to write a JavaScript alternative to allow intermingling submission actions within a form.
I’ve written a gem that may interest you. Dynaspan; with one method you can have a field that updates with the Rails server instantly upon any change. Currently permits a input field, text box, and drop-down option. It does it in the background so your page doesn’t reload and it leaves any form in the page untouched.