holden
holden

Reputation: 13591

rails and uploadify nested_attributes

I have a form for a model which has many photos and it all works fine thru the form using 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?

Upvotes: 0

Views: 330

Answers (2)

shingara
shingara

Reputation: 46914

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

Upvotes: 1

pex
pex

Reputation: 7761

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.

Upvotes: 1

Related Questions