On Sep 16, 2011, at 4:26 PM, Tim Griffin wrote:

> Hi all;
> 
> Just passing along some information conveyed to me by Bryan Larsen. 
> 
> In my controller, I had overridden an #edit action as follows:
> 
>   def edit
>      @document = Document.find_by_id(params[:id])
>      ...
>   end
> 
> The trouble with this method of loading the object being edited (the 
> document) is that it's not setting a critical, internal Hobo variable named 
> "this". The consequence of this was that my edit.dryml page's use of the 
> <delete-button> tag was creating an ajaxified "in-place" version of the 
> button instead of the usual button that would take me off the page. I would 
> click the Delete button to delete the record being edited and expected to be 
> redirected to the model's index page (as would be the automatic action after 
> the delete), but after deleting the object, my browser just sat there not 
> knowing what to do next, entertaining me with the "Removing" spinner.
> 
> It turns out that Hobo's internal code for the <delete-button> tag includes 
> the following line:
> 
>     in_place = false if in_place.nil? && this == @this && 
> request.method.downcase == "get"
> 
> In my case, the "this == @this" comparison was failing because there had been 
> no assignment to @this. 

That's quite peculiar - calling 'this' (a function) should have loaded @this 
from @document (around line 787 in lib/hobo/controller/model.rb). Was the 
controller doing this named something out of the ordinary (ie, not 
'DocumentsController')?

--Matt Jones

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/hobousers?hl=en.

Reply via email to