开发者

rails and uploadify nested_attributes

I have a form for a model which has many photos and it all works fine thru the form u开发者_如何学运维sing the nested_attributes feature in the places model.

The form for is like this:

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

And produces in html

This:

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

But when I start using uploadify it takes a script path as a param which I gave

<%= place_path(@place) %>

or

/places/some-record

by post, the same location as generated by the form_for

However this always returns:

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

Despite the fact that both the form_for (successful) and the uploadify script both start with this in the log

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

What am I missing?


Your log says "Started POST". Are you sure, you're calling /places/some-record as a POST-Request? Otherwise you have to allow more Method-Types.


I suppose it's a PUT method. So add PUT method accept on this route.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜