Hi, In an .rxml template, I need to have nodes named <cross-domain-policy>. However, if I use: xml.cross-domain-policy I get the following error: undefined method `domain'' It works fine if I use xml.cross_domain_policy (undercores) to generate a tag <cross_domain_policy>. Unfortunately I need the dashes in the node names - how is it done? Ingo -- 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 -~----------~----~----~----~------~----~------~--~---
For tags which have characters that are illegal in Ruby method names you
can use the xml.tag! method in .rxml:
xml.tag! ''cross-domain-policy'', ''value''
or
xml.tag! ''cross-domain-policy'' {
xml...
}
David Schmidt
Ingo Weiss wrote:> Hi,
>
> In an .rxml template, I need to have nodes named
<cross-domain-policy>.
> However, if I use:
>
> xml.cross-domain-policy
>
> I get the following error:
>
> undefined method `domain''
>
> It works fine if I use xml.cross_domain_policy (undercores) to generate
> a tag <cross_domain_policy>. Unfortunately I need the dashes in the
node
> names - how is it done?
>
> Ingo
>
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
David Schmidt wrote:> For tags which have characters that are illegal in Ruby method names you > can use the xml.tag! method in .rxml: > > xml.tag! ''cross-domain-policy'', ''value'' > > or > > xml.tag! ''cross-domain-policy'' { > xml... > } > > David SchmidtI cannot get this to work. I get an error in my Aptana IDE. For example if I want to take: [code] xml.instruct! xml.game_logs { xml.game{ xml.name(@game.name) xml.id({:type => :integer}, @game.id) } @game_logs.each { |game_log| xml.game_log{ xml.player { xml.name(game_log.player.login) xml.score(game_log.correct_answer_count) } } } } [/code] And make game_log use dashes. What is the syntax? Thanks. -- 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 -~----------~----~----~----~------~----~------~--~---
Actually I got it working in that example.
[code]
xml.game_logs {
[/code]
becomes
[code]
xml.tag!(''game-logs'') {
[/code]
but what about here:
[code]
xml.is_correct({:type => :boolean}, answer.is_correct)
[/code]
this does not work:
[code]
xml.tag!(''is-correct'', {:type => :boolean},
answer.is_correct)
[/code]
--
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
-~----------~----~----~----~------~----~------~--~---
Nothing to see here - user error. That code works! Thanks. -- 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 -~----------~----~----~----~------~----~------~--~---