<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                | API | SOURCE | | --- | --- | | Google GSON | [http://code.google.com/p/google-json/](http://code.google.com/p/google-json/) | | SOJO | [http://sojo.sourceforge.net/](http://sojo.sourceforge.net/) | | org.json (by Douglas Crockford) | [http://www.json.org/java](http://www.json.org/java) | | json-lib | [http://sourceforge.net/projects/json-lib/](http://sourceforge.net/projects/json-lib/) | | json-io | [http://code.google.com/p/json-io](http://code.google.com/p/json-io) | | jsontools | [http://jsontools.berlios.de/](http://jsontools.berlios.de/) | | jsonbeans | [http://code.google.com/p/jsonbeans/](http://code.google.com/p/jsonbeans/) | | ActiveSupport JSON | [http://api.rubyonrails.org/classes/ActiveSupport/JSON.html](http://api.rubyonrails.org/classes/ActiveSupport/JSON.html) | | Yajl | [https://github.com/brianmario/yajl-ruby](https://github.com/brianmario/yajl-ruby) | | Oj | [https://github.com/ohler55/oj](https://github.com/ohler55/oj) | Ruby on Rails提供了額外的功能,這使得轉換Ruby對象為JSON更容易。下面的控制器使用ActionController的渲染方法輸出地址對象到JSON: ~~~ class Person attr_accessor :first_name, :last_name def initialize(first_name=nil, last_name=nil) @first_name = first_name @last_name = last_name end end class MyController < ApplicationController def index person = Person.new('John', 'Doe') respond_to do |format| format.html # index.html.erb format.json { render :json => person} end end end ~~~ Rails的應用控制器負責編寫對象為JSON格式或者解析JSON文件為對象。所以沒有必要在這里寫to_json方法
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看