Hi,
I was advised to use either the :methods option of to_xml or use a block
to add additional tags to the output. What I''m trying to do is add a
permalink tag to each element in a collection, but I can''t seem to get
it right.
If I use the :methods option of to_xml, I''d need to access an url
helper
from a model, and I haven''t figured that out yet.
When using either a proc or a block I don''t know how to get the current
record from the collection in order to use a url helper. For example:
render :xml => @messages do |options|
options[:builder].tag!(''permalink'',
message_url(WHAT_DO_I_PUT_HERE?)
end
Any pointers?
Thanks in advance.
- Ivan V.
--
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-/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
-~----------~----~----~----~------~----~------~--~---