Oh, you might want to add some sort of typed_id or the like to the names so it can handle multiple expando's on one page.
On Nov 22, 1:23 pm, kevinpfromnm <[email protected]> wrote: > what if you drop the action and add method="get"? > > On Nov 20, 4:43 am, Ignacio Huerta <[email protected]> wrote: > > > Hi Bryan, > > > Thank you very much the idea: I just tested the code and it works > > beautifully :D. The only thing I had to change was the destiny route of > > the form: > > > This is the original code that crashes in my app: > > <form action="show" update="expando"> > > > After some testing, I discovered that this worked: > > <form action="/projects/show/53" update="expando"> > > > Ok, it works, but the route is hardcoded. So I found a solution: > > <form action="&[email protected]" update="expando" > > > > And I defined "route" in the projects model: > > def route > > return '/projects/show/' + id.to_s > > end > > > Maybe someone has a suggestion to build the route string inside the tag > > definition, so the code is less dirty. > > > Regards, > > Ignacio > > > El lun, 15-11-2010 a las 15:00 -0500, Bryan Larsen escribió: > > > > This is prompted by this feature request from Peter Ehrlich: > > >https://hobo.lighthouseapp.com/projects/8324/tickets/841-load-tags-th... > > > > Expandos are those little web 2.0 widgets expand to show additional > > > content when clicked. Usually they're implemented in pure Javascript, > > > and are easy to do. For an example in jQuery, see this > > >http://jqueryui.com/demos/accordion/underthe warning "If you wnat > > > multiple sections open at once, don't use an Accordion". > > > > However, if your content is very large or expensive, you may want to > > > delay sending the content until the user actually clicks on the expando. > > > Hobo doesn't have an expando tag, but it's easy to use a hobo AJAX > > > form to do this. > > > > For example, in your show.dryml, you could have something like this: > > > > <div part="expando"/> > > > <if test="¶ms[:opened]=='opened'"> > > > <form action="show" update="expando"> > > > <input type="hidden" name="opened" value="closed"/> > > > <submit label="close"> > > > </form> > > > big expensive content here. > > > </if> > > > <else> > > > <form action="show" update="expando"> > > > <input type="hidden" name="opened" value="opened"/> > > > <submit label="open"> > > > </form> > > > </else> > > > </div> > > > > hobo_show doesn't normally include ajax support, so you'll have to add it: > > > > def show > > > hobo_show do > > > hobo_ajax_response if request.xhr? > > > end > > > end > > > > I haven't actually tested this code, so it may need some tweaks, but > > > hopefully somebody finds it useful. (And if you do get it working, it > > > would probably make a good recipe). > > > > Bryan > > > --www.ihuerta.net > > Email realizado con Software Libre > > > signature.asc > > < 1KViewDownload -- 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.
