Remote_form_for works only in IE, not Firefox

Hi, I’ve a strange problem - When the params content of the controller
is different (and incomplete) when posted by Firefox.

<% remote_form_for(:article, @article, :url => { :action => :edit },
:html => {:method=> :POST} ) do |f| %>
<%= f.select(:rubrique_id, arbre_select(@rubriques)) %>
<%= f.text_field :titre, :size => 64 %>
<%= f.text_area :resume, {:cols => 60, :rows =>5} %>
<%= f.text_area :contenu, {:cols => 60, :rows =>20, :class =>
‘mceEditor’ } %>
<%= f.check_box :publie %>
<%= text_field_tag :tags, @article.tag_list, :size => 64, :autocomplete
=> ‘off’ %>

<%= auto_complete_field('tags', :url => url_for(:controller => 'admin_tags', :action => 'auto_complete'), :min_chars => 3, :tokens => ',') %> <%= link_to('Annuler', :action => 'index') %> <%= submit_tag 'Enregistrer' %> <% end %>

pp params output with Firefox is
{“action”=>“edit”, “id”=>“5”, “controller”=>“admin_articles”}

All the fields of the form are omited

pp params output with IE is
{“article”=>
{“modifie_par”=>“1”,
“rubrique_id”=>“1”,
“publie”=>“1”,
“id”=>“5”,
“resume”=>"",
“titre”=>“Bienvenue !!”,
“contenu”=>""},
“commit”=>“Enregistrer”,
“tags”=>"",
“action”=>“edit”,
“id”=>“5”,
“controller”=>“admin_articles”}

What’s wrong ??

Thanks

Any idea around ? Does some of you had any problem with Ajax and Firefox
?

Just to be clear about the problem : the fields of the form are not
posted (or at least their values are not in params[]) correctly with
FireFox while it works fine with IE

Any help appreciated…

Thanks

This may or may not help, but the first approach I have whenever
debugging different results among different browsers, is validate the
html http://validator.w3.org/ . Generally invalid code will have
inconsistencies among browsers, especially where javascript is
concerned.

I hope that helps.

-Zach

Just to be clear about the problem : the fields of the form are not
posted (or at least their values are not in params[]) correctly with
FireFox while it works fine with IE
I never used “:html => {…}”, just :method => :post.
Have you looked at the generated HTML code? Have you tried debugging the
JavaScript code with Firebug
(https://addons.mozilla.org/en-US/firefox/addon/1843)?

Happy coding

Any idea around ? Does some of you had any problem with Ajax and Firefox
?

Just to be clear about the problem : the fields of the form are not
posted (or at least their values are not in params[]) correctly with
FireFox while it works fine with IE

Is the request being submitted to Rails with Firefox? Or is nothing
happening at all? And if the latter, are you using Rico? Try removing
Rico and see if it solves the problem.

Philip H. wrote:

Is the request being submitted to Rails with Firefox? Or is nothing
happening at all? And if the latter, are you using Rico? Try removing
Rico and see if it solves the problem.

Yes with Firefox the request is submitted with params containing only
{“action”=>“edit”, “id”=>“5”, “controller”=>“admin_articles”}, and
nothing about the fields of the form.

I read somewhere that you need to use :update=> in order to let the
form work; if the :update option is not needed use :update=>{} as
workaround
Sandro, www.railsonwave.com

Got it, Zach was right :
http://lists.rubyonrails.org/pipermail/rails-spinoffs/2006-April/003443.html

I’ve found the reason, even if I have no solution : the HTML code
generated by remote_form_for is

And when I check the result of Form.serialize(this) I can see the values
when under IE but nothing under Firefox.

This happen even with <%= javascript_include_tag :defaults %>

I’ve checked the javascript Rails files under public/javascript and
there are the latest - rake rails:update did his job

Still searching…

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs