#876 ✓resolved
Tomoaki Hayasaka

"wrong number of arguments" in ajax_update_response.

Reported by Tomoaki Hayasaka | November 27th, 2010 @ 09:51 PM | in Hobo 1.3 (Rails 3)

1.3.0.pre22

"ajax_update_response" calls "controller_action_from_page_path" with an argument (page_path) but "controller_action_from_page_path" is defined as zero-arg method.

Fix (I'm assuming "ajax_update_response" is not a part of public API):

diff --git a/hobo/lib/hobo/controller.rb b/hobo/lib/hobo/controller.rb
index bd838ea..c32aa53 100644
--- a/hobo/lib/hobo/controller.rb
+++ b/hobo/lib/hobo/controller.rb
@@ -58,10 +58,9 @@ module Hobo
 
     def hobo_ajax_response(*args)
       results = args.extract_options!
-      page_path = params[:page_path]
       r = params[:render]
       if r
-        ajax_update_response(page_path, r.values, results)
+        ajax_update_response(r.values, results)
         true
       else
         false
@@ -69,15 +68,13 @@ module Hobo
     end
 
 
-    def ajax_update_response(page_path, render_specs, results={})
-      if page_path
-        controller, action = controller_action_from_page_path(page_path)
-        identifier = view_context.view_paths.find( action,
-                                                   controller,
-                                                   false,
-                                                   view_context.lookup_context.instance_variable_get('@details')).identifier
-        renderer = Dryml.page_renderer(view_context, identifier, [], controller)
-      end
+    def ajax_update_response(render_specs, results={})
+      controller, action = controller_action_from_page_path
+      identifier = view_context.view_paths.find( action,
+                                                 controller,
+                                                 false,
+                                                 view_context.lookup_context.instance_variable_get('@details')).identifier
+      renderer = Dryml.page_renderer(view_context, identifier, [], controller)
 
       render :update do |page|
         page << "var _update = typeof Hobo == 'undefined' ? Element.update : Hobo.updateElement;"
--

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

People watching this ticket

Tags

Referenced by

Pages