Forum: Ruby on Rails xml missing template

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
1cba2ef9e78a15320bbfc58c1428aa52?d=identicon&s=25 Matt (Guest)
on 2008-10-16 10:18
(Received via mailing list)
Hello,

I am building my first rails 2 app and using xml builder for the first
time.  After digging around I some builder tutorials, yay :-)  But I
have quickly run into a problem.  When I name my file
title.xml.builder I get this error:

Template is missing

Missing template search/title.html.erb in view path /home/matt/aws/app/
views

and when I name my file title.rxml I get no output.  If I have the
file named .html.erb I do get the output that is in the file.  I have
require 'builder' in my controller.  I am using apache with passanger,
and I am running in development environment.  Just wondering if anyone
has some input?

Thanks
Matt
1b507a552850441a516948d488962d2e?d=identicon&s=25 Sniper Abandon (mokkai)
on 2008-10-16 13:09
Matt wrote:
> Hello,
>
> I am building my first rails 2 app and using xml builder for the first
> time.  After digging around I some builder tutorials, yay :-)  But I
> have quickly run into a problem.  When I name my file
> title.xml.builder I get this error:
>
> Template is missing
>
> Missing template search/title.html.erb in view path /home/matt/aws/app/
> views
>
> and when I name my file title.rxml I get no output.  If I have the
> file named .html.erb I do get the output that is in the file.  I have
> require 'builder' in my controller.  I am using apache with passanger,
> and I am running in development environment.  Just wondering if anyone
> has some input?
>
> Thanks
> Matt

in your browser
try
http://localhost/search/title.xml
1cba2ef9e78a15320bbfc58c1428aa52?d=identicon&s=25 Matt (Guest)
on 2008-10-16 20:00
(Received via mailing list)
Hmmm,

when I do that I get a:
Routing Error
No route matches "/search/title.xml" with {:method=>:get}

And also I want to pass in something after title like /search/title/
dogs or something like that...

On Oct 16, 6:09 am, Sniper Abandon <rails-mailing-l...@andreas-s.net>
8fa0f5c2bf8ad238baa4e20cb0360ebd?d=identicon&s=25 Matt Harrison (iwasinnamuknow)
on 2008-10-16 22:27
(Received via mailing list)
Matt wrote:
> Hmmm,
>
> when I do that I get a:
> Routing Error
> No route matches "/search/title.xml" with {:method=>:get}

I had much the same error implementing xml builder for the first time
today also. I ended up mapping a route specifically for it like so:

map.connect '/people/export.xml', :controller => 'people', :action =>
'export', :format => 'xml'

It didn't work like any tutorial I found said it should work but bodging
it like this seems to work for now.

> And also I want to pass in something after title like /search/title/
> dogs or something like that...

I think you could do this by modifying the above route.

HTH

Matt
This topic is locked and can not be replied to.