winter heat wrote: > if the HAML is: > > .class1 > .class2 > .class3 > %div > content... many lines > > How can it be made so that it doesn't respond with class1 and class2 if > it is Ajax?
Well, it's not quite clear what you really want. First of all, do you need to nest the divs at all? Remember that one element can have multiple classes, so .class1.class2.class3 is possible. If not, then can you extract the .class1 and .class2 into a layout? > > - if !request.xhr? > .class1 > .class2 > > .class3 > %div > content... many lines > > won't work, because if not Ajax, then class3 is not a child of class2. > It might have to be something like > > - if !request.xhr? > .class1 > .class2 > .class3 > %div > content... many lines > - else > .class3 > %div > content... many lines > > and it is repeating a lot of code. Can it be structure within the same > file? Perhaps, but your view shouldn't be testing request.xhr? . That's a terrible idea. > Or the second part made into a partial? That's probably a better idea. Best, -- Marnen Laibow-Koser http://www.marnen.org [email protected] -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" 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/rubyonrails-talk?hl=en.

