rails 3 form remote -


i write:

<%= form_for(current_user, :remote => true) %>   <p>     <%= label_tag t("language") %>:      <%= select_tag "language", options_for_select([["Русский", "rus"], ["english", "eng"]]) %>   </p>    <p><%= submit_tag t "options.save" %></p> <% end %> 

inspector: http://deeflow.com/changer/inspect.png

content: http://deeflow.com/changer/content.png

but, value in db doesn't updated

<%= form_for(current_user, :remote => true) |f| %>   <p>     <%= f.label :language, t("language") %>:      <%= f.select :language, options_for_select([["Русский", "rus"], ["english", "eng"]]) %>   </p>    <p><%= f.submit t "options.save" %></p> <% end %> 

notice variable |f| , change of label_tag, select_tag , submit_tag f.label, f.select , f.submit

in rails form_for , corresponding form_buider object(|f|) used group values under common key, rails can understand. *_tag helpers used pass unrelated parameters.


Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -