David Zhu wrote in post #961692:> Hey guys,
>
> I have a quick question about xml.builder rendering in Rails. I''m
> pretty sure I am just getting the builder syntax wrong.
>
> The problem is that I can''t get it to display things that I want
> rendered out. By looking at the logs it seems like Rails has found
> everything, but my syntax for displaying is wrong, so it displays
> nothing.
>
> I would like to display for example,
>
> post.title
> post.author
> post.body
>
> That''s all wrapped in a for loop, that should display all the
posts. I
> did a respond to xml in the controller, and I defined all my variables
> correctly. However, I''m getting a blank screen.
>
> What''s the equivalent of <%= %> in xml.builder syntax?
http://builder.rubyforge.org/
But consider not using Builder. Haml works just as well for XML as it
does for HTML, as does ERb (though it''s less pleasant than Haml). I
find Builder to be more trouble than it''s worth in many cases.
>
> Thank you
Best,
--
Marnen Laibow-Koser
http://www.marnen.org
marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org
--
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.