I'm trying to make Ajax calls work the way I need them, and after some trouble I've created a very small example to show my issue. The following code works (the random number is updated):

  <h3 part="welcome"><%= rand.to_s %></h3>
<a href="/concepts" class="btn btn-primary" updates="#welcome">Update to index!</a>


But this code doesn't (Ajax returns error 500):

  <h3 part="welcome"><%= rand.to_s %></h3>
<a href="/concepts/new" class="btn btn-primary" updates="#welcome">Update to new!</a>

Note: I have "hobo_ajax_response" in my new action in the concepts_controller.

The error as seen in Firebug is:

undefined method `welcome_part' for #<#<Class:0x00000003af2438>:0x00000005937510>

I've been reading about part contexts in the Ajax manual and I've tried playing with "@this" in the new action. I've also debugged a bit the template_environment.rb file in the dryml gem, until:
  send("#{context.part_name}_part", *context.locals)

Does anyone know why "welcome_part" is accessible in the index action, but not in the new action? Is there any way to workaround this?

Thanks!

Regards,
Ignacio

--
Ignacio Huerta Arteche
http://www.ihuerta.net
Teléfono: 0034 645 70 77 35
Email realizado con software libre

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