similar to: Example using Builder::XmlMarkup and .rxml files?

Displaying 20 results from an estimated 900 matches similar to: "Example using Builder::XmlMarkup and .rxml files?"

2006 Jul 14
2
how to get builder 2.0 to escape attributes in rxml
I am using rxml to produce opml files and need to escape ampersands in the attributes. builder 2.0 docs found at http://builder.rubyforge.org/ show the following xml = Builder::XmlMarkup.new xml.sample(:escaped=>"This&That", :unescaped=>:"Here&amp;There") xml.target! => <sample escaped="This&amp;That"
2007 Oct 10
1
rxml cdata problem!!!!!
source) xml.list {xml.cdata! "test"} result) <list> <![CDATA[test]]> </list> but I want to <list><![CDATA[test]]></list> (because firefox don''t understand first result) how to????? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails:
2006 Apr 27
3
XML output
Hi, Sorry abt the half finished post that I sent out earlier. The idea is to generate an output xml response as such: <?xml version="1.0" encoding="ISO-8859-1" ?> <response status=''NOT_AVAILABLE''> <message>Some text</message> <from>Me</from> </response> I make a request like such
2006 Nov 21
1
RXML vs form_tag etc
Railsers: The documentation for *.rhtml views invariably mentions *.rxml views. They sound like a Good Thing, because some of my generating code mixes Ruby and HTML so densely that the code is full of %><% markers. Dropping down to only one language would be a blessing. However, this documentation invariably avoids mentioning one tiny, insignificant detail: How do you inject raw HTML
2006 Jan 30
5
a RJS problem/patch
Hi, add_rjs_to_action_view.rb of javascript_generator_templates doesn''t work with setting Content-Type in a controller. (e.g.) http://wiki.rubyonrails.org/rails/pages/HowtoSetDefaultEncoding class ApplicationController < ActionController::Base before_filter :set_charset def set_charset @headers["Content-Type"] = "text/html; charset=utf-8" end end I
2007 Jun 11
2
Builder::XmlMarkup and dashes
Has anyone hacked Builder::XmlMarkup to dasherize underscore tags by default? I know I can use tag!, but I''d like to find a way for it to translate underscores to dashes automatically. In other words: xml.department_manager do "fred end #=> <department-manager>fred</department-manager> I tried hacking Builder::XmlBase.method_missing but got myself all twisted up!
2007 Nov 21
4
Builder::XmlMarkup adds <inspect/> on printing and <clone/> on saving
Hello, I am new in this group. Please give me a short hint, in case this is the wrong place for my posting. I want to create an XML file and store it in "filetransfer". The XML part of the file (the body) sould go to "filetransfer.data". Despite the last line, everything is fine with the code below. With "filetransfer.save" two entries "<clone/>"
2009 Jan 21
1
AR to_xml problem with associations, Builder::XmlMarkup#to_a
When I do a to_xml(with a block) on an association of a model I got a Builder::XmlMarkup#to_ary should return Array Example that does not work. @intervenant = Intervenant.find(params[:id]) output = @intervenant.to_xml( :skip_types => false, :dasherize => false) do |xml| @intervenant.individu.to_xml( :builder => xml, :skip_instruct => true, :skip_types => false,
2006 Dec 12
2
RXML partial question
All, I have a RXML template which renders partial RXML templates within it. A snippet is below. The "xml" variable is the parent template''s Builder variable. It is passed into the partial under the name "parent_xml". Why can''t I use :locals => {.... :xml => xml ....} in my call to render the partial? It seems like if I do use :xml => xml, it
2008 Apr 20
1
Why is respond_to always rending the RXML view?
I''m having a problem in Rails 2 where respond_to is always rendering the RXML view even in the HTML rendering response. Can anyone tell me why this might be happening? Here''s a code snippet: respond_to do |accepts| accepts.html accepts.xml { render :action => ''show.rxml'', :layout => false} end If I change this to the following it works fine:
2006 Aug 30
1
Shouldn't rxml files be exempt from layout by default?
RJS templates are the only template type that are exempt from layout by default. Don''t you think it makes sense to add rxml to the list of exempt extensions? I''d assume most people would be surprised to see their XML embedded in the middle of their (most probably) rhtml layout. http://dev.rubyonrails.org/svn/rails/trunk/actionpack/lib/ action_controller/base.rb:
2008 Oct 14
2
best-practice for programmatically using rxml generated from controller/view? (or 'how can I view a view from a model')
Hey Guys, Here''s the scenario: I''ve got vendor-specific XML I need to create and then POST it somewhere. It sounds easy enough, but I''m running into issues when it comes time to actually use the XML. Trying hard to stay within the MVC pattern I: 1) Create a controller which loads the models I''m about to turn into XML 2) Create an rxml view which renders the
2005 Apr 13
2
render_partial & RXML
Does render_partial work within a RXML file? I am attempting the following: xml.users do for user in @users render_partial ''user'', user end end All that is output is: <user> </user> Without any exception or anything to indicate that I''m doing something wrong. Does anyone have any experiece with this? Josh
2006 Jun 27
4
Action Mailer - weird rendering issues
Hello, While sending email notifications from ThoughtNotifier, I am getting weird exceptions, which sometimes occur on the production machine, but I haven''t been able to reproduce on my development machine. There should be no error while rendering `thought_notifier/share_notification.rhtml'' template, but if for some reason it is rendering
2006 May 24
5
rxml vs rhtml
I have been wondering if anyone here knows which format is faster for your templates? I am curious cause in the near future I may be using some expensive scripts (timewise) and would like to try and squeak out as much performance as possible. Is Ruby like other languages (ASP classic for example) that inccur a penalty by switching between HTML and Ruby Code? Ben -- Posted via
2005 Nov 03
1
Builder / rxml views: hyphens in XML element names
I''m having a strange problem with an rxml view - it won''t let me put hyphens in the names of XML elements. The original problem line was: xml.VISA-SSL do But in any other place, if I insert a hyphen into the name of any arbitrary element, I get the following kind of error: undefined method `theTextAfterTheHyphen'' for #<#<Class:0xb7617180>:0xb7616f28>
2006 Jul 12
1
RXML returns a blank page
Hello, I built a simple rxml page that should print the contents of a table in XML. It works perfect localy, using Mongrel. But I have a VPS server with the same data, but running Lighhtpd. There, it returns a blank page.... Is it because of mongrel/lighttpd ? How could I fix that ?? Thanks, Parra -------------- next part -------------- An HTML attachment was scrubbed... URL:
2006 May 30
2
No rhtml, rxml, rjs... problem with Action Mailer, again
Hi all I have seen a lot of people writing my same problem but I haven''t found the solution yet. This is the problem: "ActionView::ActionViewError in Periodico#index No rhtml, rxml, rjs or delegate template found for..." when trying to send email through action mailer. I have created the Notifier.rb model (in app/models/ folder) def signupthanks(user) # Email
2006 Feb 02
1
actionmailer - No rhtml, rxml, or delegate template
I''m getting this error when I try to send an email. No rhtml, rxml, or delegate template found for signup_thanks But I do have signup_thanks.rhtml in app/view/notifier This is in the notifier model. class Notifier < ActionMailer::Base def signup_thanks(sent_at = Time.now) @subject = "the subject works!" @body["first_name"] = "first name"
2006 Feb 18
1
Should assert_tag be used to test rxml views?
I''m getting strange errors attempting to test an rxml view with assert_tag. I can see that what the view is producing is correct but I get an error like "ignoring attempt to close foo with bar" (where bar is a tag which is meant to be nested in foo). Is asssert_tag meant for xml, or just html? Cheers, Robert. -- Posted via http://www.ruby-forum.com/.