On Feb 26, 9:28 am, MattFS218 <[email protected]> wrote:
> I have a Contacts controller, that I'm using to output contacts when
> an index is called, but the XML that I will output for each contact
> varies. I'm not having any success using :proc or :method
>
> :method could work, but the string my method returns, escapes the <>
> characters I'm using trying to "fake" XML mark-up.
>
> Basically, each contact has many Kvs, and I only want to :include
> output some KV (not all) for each contact. I can :include kvs but that
> will include ALL. I cannot used proc, because there's no way for proc
> to "know" which individual contact it's being run for.

It seems like the easiest way would be a method that calls to_xml on
those kvs you want included. Not sure what you meant about fake xml
mark-up in your comment above. Another way might be to :include an
association whose conditions restrict it to those Kvs you are
interested in.

Fred

Fred
>
> Can anyone recommend an easy way around this?
>
> --matt
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to