Bryan.
Thanks for the quick response.

No, you shouldn't need any custom controller actions to make this
> work, although if you have customized your controller actions, it's
> easy to break them.   If you have customized it, please post it.
>

Nope, no custom Controllers.  i was thinking that it was too simple to need
them.

>
> Please confirm that you have the right action and that everything
> works without by trying <a><name/></a>.
>

Yeah, have done so.  The link works fine without the ajax additions.

>
> Please check to see if you're geting any javascript errors in your
> javascript console.   If so, please post.
>

I see no errors in the console.  When I don't use push-state in the <a>, it
shows a jquery.js script that is text/javascript type that supposedly is
working fine.  When I do include push states, it acts as if it were
<a></name></a>.

Wait I found an error for the push state that was getting thrown up before
I could notice it.

Uncaught TypeError: converting circular structure to JSON.

And then it loads the show page as a new URL. I had the debugger switch to
pause on exception caught and where it stopped was:


/**
* History.cloneObject(obj)
* Clones a object and eliminate all references to the original contexts
* @param {Object} obj
* @return {Object}
*/
History.cloneObject = function(obj) {
var hash,newObj;
if ( obj ) {
hash = JSON.stringify(obj);
newObj = JSON.parse(hash);
}
else {
newObj = {};
}
return newObj;
};

within the history_core.js.

>
> Please also check to see if you're getting any errors in your server
> logs.   If so, please post.
>

Let me post what the server shows.  Without the push-state:


Started GET
"/systems/1-5409-nc-hwy-119n?render_options%5Bpreamble%5D=&render_op
tions%5Bcontexts_function%5D=hjq.ajax.updatePartContexts&render%5B0%5D%5Bpart_co
ntext%5D=BAhbCDoPbWFpbl9wYW5lbEkiCXRoaXMGOgZFRlsA--391f70eddd839a6a90ef262df3001
1760a675873&render%5B0%5D%5Bid%5D=main-panel&render%5B0%5D%5Bfunction%5D=hjq.aja
x.update&_=1342123425937" for 127.0.0.1 at 2012-07-12 16:03:46 -0400
  Processing by SystemsController#show as JS
  Parameters: {"render_options"=>{"preamble"=>"",
"contexts_function"=>"hjq.ajax
.updatePartContexts"},
"render"=>{"0"=>{"part_context"=>"BAhbCDoPbWFpbl9wYW5lbEk
iCXRoaXMGOgZFRlsA--391f70eddd839a6a90ef262df30011760a675873",
"id"=>"main-panel"
, "function"=>"hjq.ajax.update"}}, "_"=>"1342123425937",
"id"=>"1-5409-nc-hwy-11
9n"}
  ←[1m←[36m (0.0ms)←[0m  ←[1mSELECT COUNT(*) FROM "users" ←[0m
  ←[1m←[35mUser Load (0.0ms)←[0m  SELECT "users".* FROM "users" WHERE
"users"."i
d" = ? LIMIT 1  [["id", "1"]]
  ←[1m←[36mSystem Load (0.0ms)←[0m  ←[1mSELECT "systems".* FROM "systems"
WHERE
"systems"."id" = ? LIMIT 1←[0m  [["id", "1-5409-nc-hwy-119n"]]
  ←[1m←[35mUser Load (0.0ms)←[0m  SELECT "users".* FROM "users" LIMIT 30
Rendered controller: systems; dryml-tag: show-page (197.0ms)
Completed 200 OK in 818ms (Views: 794.0ms | ActiveRecord: 0.0ms)




>
> for push-state, do you have the history-js plugin installed?
>

 I think I do.  i added it to the gem file and did a bundle install and now
it shows up on the gem list.  And then I added the line to the
application.js as described in the Readme you posted in the manual. And
history.js loads from the assets as the page is loaded.

>
> One of the trickiest things about Ajax in Hobo is ensuring that the
> context (aka this) is correct.  Hobo jumps through a bunch of hoops to
> try and do it automatically, but sometimes it needs help.   Check your
> server logs for "this_id = ..." to see what Hobo is trying to use for
> the context when it is rendering the part.
>
>
I posted the server log above but I see no :this_id =", but instead just an
"id="main-panel", which is what I am calling the part.  That could also be
the problem.  I define the part in page tag I defined to create the aside.

<def tag="systems-show">
  <page>
<content: replace>
  <section-group class="page-content">
<aside param="aside1"/>
<section param="content"><do part="main-panel"></do></section>
  </section-group>
</content:>
  </page>
</def>

Question.  Should this work both ways, with and without the push-state?  If
so, what is the difference between the push state and just using the ajax
calls on the link function alone?

Thanks a lot for your help.  I seem to have trouble finding enough sample
code of Hobo to figure out certain things.

Richard

>
>

-- 
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