addressalign-toparrow-leftarrow-rightbackbellblockcalendarcameraccwcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-checkcircle-with-crosscircle-with-pluscontroller-playcrossdots-three-verticaleditemptyheartexporteye-with-lineeyefacebookfolderfullheartglobegmailgooglegroupshelp-with-circleimageimagesinstagramFill 1launch-new-window--smalllight-bulblinklocation-pinm-swarmSearchmailmessagesminusmoremuplabelShape 3 + Rectangle 1ShapeoutlookpersonJoin Group on CardStartprice-ribbonprintShapeShapeShapeShapeImported LayersImported LayersImported Layersshieldstartickettrashtriangle-downtriangle-uptwitteruserwarningyahoo

Re: [ruby-72] Still need some RoR help

From: Anthony E.
Sent on: Thursday, November 1, 2007 12:00 AM
I wanted to seperate the markup from the tree walk actually. Every
example I came across did what you suggested, hardcoding html in a
function buried somewhere in a helper or controller.



On 10/31/07, Paul <[address removed]> wrote:
> On Wed, 31 Oct 2007, Dean wrote:
> > might be cleaner to just to use a partial and recurse with that instead...
>
> Totally.  It was a quick one-off to demo the recursion.
>
> ...Paul
>
> >
> > On 10/31/07, Paul <[address removed]> wrote:
> >> On Wed, 31 Oct 2007, Anthony wrote:
> >>> I do have some issues walking an acts_as_tree object to produce a
> >>> nested <ul> list...with an unlimited level of nesting.
> >>
> >> Never used it, but it sounds like it's a fairly simple recursive
> >> algorithm.
> >>
> >> def display_level(obj)
> >>    output = "<ul>\n"
> >>    obj.children.each() do | child |
> >>      output += "<li>" + child.to_s + "</li>\n"
> >>      if child.children.lengt­h > 0
> >>      output += display_level(child)­
> >>    end
> >>    output += "</ul>\n"
> >> end
> >>
> >> <%= display_level(root) %>
> >>
> >> No?
> >>
> >> ...Paul
> >>
> >>              ** ...Paul, [address removed], Insane Engineer **
> >>       ** Visit Project Galactic Guide http://www.galact...­ **
> >>                 If it's not the same, it should be different.
> >>
> >>
> >>
> >>
> >> --
> >> Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
> >> This message was sent by Paul ([address removed]) from Silicon Valley Ruby on Rails.
> >> To learn more about Paul, visit his/her member profile: http://ruby.meetu...­
> >> To unsubscribe or to update your mailing list settings, click here: http://www.meetup...­
> >>
> >> Meetup.com Customer Service: [address removed]
> >> 632 Broadway New York NY 10012 USA
> >>
> >>
> >
> >
> >
> > --
> > Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
> > This message was sent by Dean ([address removed]) from Silicon Valley Ruby on Rails.
> > To learn more about Dean, visit his/her member profile: http://ruby.meetu...­
> > To unsubscribe or to update your mailing list settings, click here: http://www.meetup...­
> >
> > Meetup.com Customer Service: [address removed]
> > 632 Broadway New York NY 10012 USA
> >
>
>              ** ...Paul, [address removed], Insane Engineer **
>       ** Visit Project Galactic Guide http://www.galact...­ **
>        "Reality is merely an illusion, albeit a very persistent one."
>                              -- Albert Einstein
>
>
>
> --
> Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
> This message was sent by Paul ([address removed]) from Silicon Valley Ruby on Rails.
> To learn more about Paul, visit his/her member profile: http://ruby.meetu...­
> To unsubscribe or to update your mailing list settings, click here: http://www.meetup...­
>
> Meetup.com Customer Service: [address removed]
> 632 Broadway New York NY 10012 USA
>
>


-- 
Anthony Ettinger
Ph:[masked]
var (bonita, farley) = new Dog;
farley.barks("very loud");
bonita.barks("at strangers");

http://chovy.dynd...­
http://utuxia.com...­

Our Sponsors

  • Rocket Fuel

    We are hiring!

  • RailsCasts.com

    Become a Ruby on Rails Pro w Ryan Bates's Pro Edition!

  • Tropo.com

    Food and Drink Sponsor!

  • JetBrains

    1 RubyMine license to be raffled per month.

  • InformIT

    Up to 35% off every purchase on informIT.com, Code USERGROUP

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy