Welcome Guest | Login

what is xml equivalnet for html.erb?

OK. rxml & rhtml used to work in my application. Now I have moved all html to html.erb; this works fine.

as for xml....

I renamed foo.rxml to foo.xml.erb for controller method foo. However, rails ruuntime  render() does not pick up the foo.xml.erb, it complains about a missing foo.html.erb

Eh?

2008-04-22 06:58 AM

Old guy still coding
Hi,

I checked the rails API documentation and found that .builder (formerly .rxml) signals Rails to execute the template with Jim
Weirich’s Builder::XmlMarkup library, used to easily create XML-based output. You can check the API doumentation given below:
http://api.rubyonrails.com/classes/ActionView/Base.html

2008-04-22 01:39 PM

Thanks! solved.

the changes required were:

1) for method foo, create foo.xml.builder

2) to invoke from method foo, instead of render use

respond_to do |format|
format.xml {@param1 = set_your_param1()
            @param2 = whatever }
end


2008-04-23 08:02 PM

Old guy still coding

Hello Guest! In order to post you must be an active client with us, please log in or sign up today!