简体   繁体   English

使用render => json时出错

[英]error using render=>json

I have the following in my controller. 我的控制器中有以下内容。 My requirement is to populate the second drop down based on the input from the 1st drop down. 我的要求是根据第一个下拉列表的输入填充第二个下拉列表。

def  update_releases 
 puts "inside func"
 project = Project.find(params[:project_id]) 
 @releases = project.releases
 puts "releases==#{releases}"
 render :json => @releases.map{|c| [c.id, c.name]} 
end 

I am getting the error: 我收到错误消息:

Started GET "/javascripts/jquery-ujs.js" for 172.30.11.164 at Thu Oct 20 14:22:06 +0530 2011 在2011年10月20日星期四14:22:06 +0530开始为172.30.11.164获取GET“ /javascripts/jquery-ujs.js”

ActionController::RoutingError (No route matches "/javascripts/jquery-ujs.js"): ActionController :: RoutingError(没有路由匹配“ /javascripts/jquery-ujs.js”):

Kindly help me out here. 请在这里帮助我。

Thanks, Ramya. 谢谢,拉米亚

You are trying to include the file jquery-ujs.js which doesnt exist. 您正在尝试包括不存在的文件jquery-ujs.js。 Either you include a file that requires the jquery-ujs.js or you try it directly. 您要么包含一个需要jquery-ujs.js的文件,要么直接尝试它。 Change your app/views/layout/application.html.erb and set the correct filename to include jquery. 更改您的app / views / layout / application.html.erb并设置正确的文件名以包含jquery。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM