Martin Rehfeld 发布了Ext for rails 的Generator,新增了MIMETYPE ext_json, 并且继承了 Array 和 ActiveRecord::Base 提供 ext_json 方法。
近来Ext开始越来越红火起来,rails+ext 也许是个不错的选择。
近来Ext开始越来越红火起来,rails+ext 也许是个不错的选择。
# GET /posts
# GET /posts.ext_json
def index
respond_to do |format|
format.html # index.html.erb (will fire ext_json request)
format.ext_json { render :json => Post.find(:all).to_ext_json }
end
end
来自:GL Networks Inside


评论 共 4 条 发表评论
flymonk 2008-01-25 09:39
laiseeme 2008-01-25 08:58
darkhucx 2008-01-25 08:50
wuguoming2004 2008-01-25 08:14
近来Ext开始越来越红火起来,rails+ext 也许是个不错的选择。
Java代码 复制代码
1. # GET /posts
2. # GET /posts.ext_json
3. def index
4. respond_to do |format|
5. format.html # index.html.erb (will fire ext_json request)
6. format.ext_json { render :json => Post.find(:all).to_ext_json }
7. end
8. end
# GET /posts
# GET /posts.ext_json
def index
respond_to do |format|
format.html # index.html.erb (will fire ext_json request)
format.ext_json { render :json => Post.find(:all).to_ext_json }
end
end
来自:GL Networks Inside
什么java代码 明明ruby代码 编辑新闻的也太不负责了吧