On 23 Apr 2008, at 05:46, Neeraj Kumar wrote:
>
> In my show.xml.builder I have following code.
>
>
> xml.events {
>
> <% @events.each do |event| %>
> xml.event event.name
> xml.id event.id
> <% end %>
> }
>
>
>
> But the above code doesn''t work. Anyone knows how to incorporate
> looping
> in .xml.builder file.
>
builder isn''t erb: there are no <% or <%
xml.events {
@events.each do |event|
xml.event event.name
xml.id event.id
end
}
should work (although i suspect that''s not the output you wanted.
Fred
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---