我无法找到有关create.js.erb和destroy.js.erb如何适合Rails 3应用程序的文档。
应用程序>控制器中这些类型的Javascript文件背后的逻辑是什么? 他们如何以及何时访问?
I haven't been able to find documentation that talk about how create.js.erb and destroy.js.erb fit in a Rails 3 app.
What is the logic behind these types of Javascript files in the app > controllers? How and when are they accessed?
最满意答案
文件扩展名与Mime类型相关联。 在这里查看我的答案。 它是为Rails 2.2.2编写的,但同样的逻辑仍然存在。 请注意,Rails 3中的respond_to语法已更改。 此外,这些文件不在app/controllers ,而是在app/views/<controller_name>/
File extensions are associated with Mime types. Check my answer here. It was written for Rails 2.2.2, but the same logic still holds. Note that the respond_to syntax has changed in Rails 3. Also, these files are not in app/controllers, but in app/views/<controller_name>/
更多推荐
发布评论