Hi there, I have this ajax problem, I''m desparately trying to debug since 1 entire day now: The Controller includes: ======================= [...] render :update do |page| page.replace_html ''coverletter_part'', :partial => ''user/applicationfiles/coverletter_part'' end [...] The View includes: ================= [...] <div id="coverletter_part"> </div> [...] The _coverletter_part partial: ============================= <% form_for(:coverletter, :url => { path/to/call/the/above/mentioned/controller }) do |f| -%> [...] <% end -%> Calling the controller, I get an error message *of this type* printed on my screen: (the actual error message is much longer, since it''s filled up with lots of stuff) try { ...blah... } catch (e) { alert(''RJS error:\n\n'' + e.toString()); alert('' ...blah... ''); throw e } Why does the javascript code not get executed? (Actually, within the same project, I''ve proceeded in the same exact way to update another DIV on the same exact view, just before calling the above mentioned controller. And it worked. How come it doesn''t work this (second) time?) Can anybody save my weekend? That would be so cool! Thanks very much! Tom -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Oct 18, 11:21 am, Tom Ha <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hi there, > > I have this ajax problem, I''m desparately trying to debug since 1 entire > day now: >What''s calling the action? If you''ve passed an :update option to link_to_remote (or remote_function etc...) then you must not use render :update Fred --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Well, this is the form that calls the action (so there is no "remote_" to the form or submit tag). <% form_for (:cv, :url => ''/user/cvs'', :html => { :multipart => true }) do |f| %> <p> Upload A CV: <%= f.file_field :uploaded_data %> <%= hidden_field_tag ''applicationfile_id'', @applicationfile.id %> </p> <p> <%= submit_tag ''Save'' %> </p> <% end %> Everything gets uploaded correctly with it. But it doesn''t update the page (the DIV/partial), but instead just displays the javascript code... -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Oct 18, 4:55 pm, Tom Ha <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Well, this is the form that calls the action (so there is no "remote_" > to the form or submit tag). >If it''s just a regular post (ie not using remote_form_for) you can''t use render :update. Fred> <% form_for (:cv, :url => ''/user/cvs'', :html => { :multipart => true }) > do |f| %> > <p> > Upload A CV: > <%= f.file_field :uploaded_data %> > <%= hidden_field_tag ''applicationfile_id'', @applicationfile.id %> > </p> > <p> > <%= submit_tag ''Save'' %> > </p> > <% end %> > > Everything gets uploaded correctly with it. But it doesn''t update the > page (the DIV/partial), but instead just displays the javascript code... > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
If you need this to be Ajaxified use remote_form_for instead, also check out: http://www.caboo.se/articles/2007/4/2/ajax-file-upload, as you''re uploading file data. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks for the clarification and your hints, guys! -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Maybe Matching Threads
- Ajax page.replace_html model validation render partial errors
- page.replace_html render(:action => ''other_action'')
- Getting Ajax.Updater or page.replace_html to render js?
- Error: "ActionController::InvalidAuthenticityToken"
- Re: page.replace_html "#{var_containing_id_name}", :partial