【问题标题】:rails and uploadify nested_attributesrails 和 uploadify nested_attributes
【发布时间】:2023-03-27 12:30:02
【问题描述】:

我有一个模型的表单,其中包含许多照片,并且通过使用 places 模型中的nested_attributes 功能的表单,它都可以正常工作。

for的形式是这样的:

<% form_for @place, :html => { :multipart => true } do |f| %>

并在html中生成

这个:

<form method="post" id="edit_place_6933" enctype="multipart/form-data" action="/places/some-record" accept-charset="UTF-8">

但是当我开始使用 uploadify 时,它需要一个脚本路径作为我提供的参数

<%= place_path(@place) %>

/places/some-record

邮寄,与 form_for 生成的位置相同

但是这总是返回:

ActionController::RoutingError (No route matches "/places/some-record...

尽管 form_for(成功)和 uploadify 脚本在日志中都以 this 开头

Started POST "/places/some-record" for 127.0.0.1 at Wed Nov 03 13:09:42 +0100 2010

我错过了什么?

【问题讨论】:

    标签: jquery ruby-on-rails ruby-on-rails-3 paperclip uploadify


    【解决方案1】:

    您的日志显示“已开始POST”。你确定,你调用/places/some-record作为一个POST请求吗?否则你必须允许更多的方法类型。

    【讨论】:

      【解决方案2】:

      我想这是一个 PUT 方法。所以在这条路线上添加 PUT 方法接受。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2011-07-18
        • 1970-01-01
        • 1970-01-01
        • 2023-03-15
        • 2011-02-11
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多