• Rails 3 Rendering XML at 2012年08月24日

    最新进展:在 Controller 的顶部,respond_to :xml, :json action 结尾处:respond_with changes_res json 正常,xml 依旧不可以,错误信息:Missing template remote_spot_details/show with {:handlers=>[:erb, :rjs, :builder, :rhtml, :rxml, :prawn, :rxls], :formats=>[:xml], :locale=>[:zh, :zh]} in view 后来发现,如果 respond_with 是继承 ActiveRecord 就可以。但是我的 response 对象是与其它公司的系统交互的,不能直接 ActiveRecord 扔给他们,在 ActiveRecord 中,也不知道哪些是处理 xml 相关的,大家有什么好的方法没?

  • Rails 3 Rendering XML at 2012年08月24日

    http://guides.rubyonrails.org/layouts_and_rendering.html提到 2.2.9 Rendering XML Rails also has built-in support for converting objects to XML and rendering that XML back to the caller:

    render :xml => @product You don’t need to call to_xml on the object that you want to render. If you use the :xml option, render will automatically call to_xml for you. 我试了,还是不可以。。。

  • Rails 发布 WebService at 2012年08月01日

    我们这边都是与外部系统打交道的。 我来尝试下用 RESTfull 的方式吧。

  • Rails 发布 WebService at 2012年08月01日

    二楼能不能说的详细点,或者有什么文章推荐下 这个度娘没找到呀

  • Rails 发布 WebService at 2012年08月01日

    谢谢 huacnlee 的回复。 webservice 并不是硬性要求,但是系统本身要与其它的异构应用打交道,如 java,C#,PHP 等,感觉 webservice 标准一点