Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
XML in Rails
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
bmcc  
View profile  
 More options Sep 24, 4:39 pm
From: bmcc <barry.mcca...@gmail.com>
Date: Thu, 24 Sep 2009 13:39:08 -0700 (PDT)
Local: Thurs, Sep 24 2009 4:39 pm
Subject: XML in Rails
Hello All:

I have a general question on XML in rails. I know how to return an XML
view for the cleint to render but what if I dont want to render the
XML that is created? What if I want an XML file to be generated and
saved into a folder (through file IO.)

 I know this will generate an XML view if the client requests for an
XML formatted document:

           respond_to do |format|
        format.html
        format.xml { render :layout => false }
            end

This works if I have an xml builder template available.

This just outputs a view with every column in XML without a builder
template

        @product = Product.find(params[:id])
        @orders = @product.orders

        respond_to do |format|
            format.html
            format.xml { render :layout => false , :xml =>
@product.to_xml(:include => :orders) }
         end

But I dont want to render the XML. I want to save out a file of a
partictular model in XML format and allow Flash to take that XML and
do its own rendering. Can someone give me some insight on this.

Thanks


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Justin Blake  
View profile  
 More options Sep 24, 10:57 pm
From: Justin Blake <jbl...@gmail.com>
Date: Thu, 24 Sep 2009 19:57:29 -0700 (PDT)
Local: Thurs, Sep 24 2009 10:57 pm
Subject: Re: XML in Rails
Can you feed the Flash a URL instead of a path to a real file?

Otherwise you can save the xml to a file just like you'd write any
other file in ruby. Something like File.open('/path/to/file', 'w') { |
f| f.puts @product.to_xml } should do the trick.

--
Justin Blake
http://blog.adsdevshop.com

On Sep 24, 4:39 pm, bmcc <barry.mcca...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
bmcc  
View profile  
 More options Sep 25, 9:06 am
From: bmcc <barry.mcca...@gmail.com>
Date: Fri, 25 Sep 2009 06:06:03 -0700 (PDT)
Local: Fri, Sep 25 2009 9:06 am
Subject: Re: XML in Rails
Yes that is correct I came to that conclusion right after I started
this thread.

Thanks for the help Justin.

On Sep 24, 10:57 pm, Justin Blake <jbl...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google