SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Wizard jag5311's Avatar
    Join Date
    Jan 2003
    Location
    Somewhere in Indiana
    Posts
    3,082
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    RXML creates download box, not page

    We have an RXML template we are using for a feed, and when trying to clickt he feed link brings up a "download" box for the file versus sending us to an xml page.

    Why would this be?

    here is the template we are using

    Code:
    xml.instruct!
    
    xml.rss "version" => "2.0", "xmlns:dc" => "http://purl.org/dc/elements/1.1" do
      xml.channel do
    	xml.title	   "#{@user.handle}'s Recent Searches"
    	xml.link		url_for(:only_path => false, :controller => 'guide', :action => 'guide_profile', :id => @user.id)
    	xml.pubDate	 CGI.rfc1123_date(@paqs.first.created_at) if @paqs.any?
    	xml.description "Recent ChaCha searches made by #{@user.handle}"
    	
    	@paqs.each do |psr|
    	  xml.item do
    		xml.title		 psr.name
    		xml.link		  url_for(:only_path => false, :controller => 'category', :action => 'psr', :id => psr.paq_id)
    		  xml.description psr.name
    		  xml.pubDate	 CGI.rfc1123_date(psr.created_at)
    		  xml.guid		url_for(:only_path => false, :controller => 'category', :action => 'psr', :id => psr.paq_id)
    		  xml.author	  @user.handle
    	  end
    	end
      end
    end
    Thanks,
    Bryan

  2. #2
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    What content type is being sent from the server when you access that action?

  3. #3
    SitePoint Wizard silver trophy redemption's Avatar
    Join Date
    Sep 2001
    Location
    Singapore
    Posts
    5,269
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yup Vinnie's hit the nail on the head - it's your web server sending an incorrect Content-Type. What web server(s) are you using to deploy your Rails application?

  4. #4
    SitePoint Guru Majglow's Avatar
    Join Date
    Aug 1999
    Location
    B-Town
    Posts
    645
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think the easy fix is to throw in a @headers["Content-Type"] = "text/xml" at the end of the controller method.
    Ohai!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •