Carl J. wrote:
I’m using in_place_editor_for with RESTful routes without a problem.
Need more details on what issues you are seeing. If I recall, the action
generated by in_place_editor_for was not really RESTful, but I didn’t
really care that much since AJAX URLs aren’t seen anyway.
Also, im using a partial which isnt playing well with the
in_place_edit_field. There is a problem with variable scope, the id cant
be found and ive had to add an ugly work around, which from memory is
like the code below:
<% @track = track %>
Yup this is a known issue, I had to do the same thing.
Hey carl, thanks for your reply.
I managed to get around the above ugly fix by using the in_place_edit
control. Note, you do need the simplyhelpful plugin for the dom_id
helper.
Ok, so details of the problem im having, with in_place_editor and
restful routes.
When i click on the ok button from the in_place_editor i get an alert
type error suggesting that there is no route available. What routes do
you have configured to accept the ajax request? Do you have the
following included in your routes:
map.connect ‘:controller/:action/:id’ ?
If i alter the named route from track_path(track) to tracks_path it gets
to the create method. So it appears to be a problem with the lack of a
put.
It would be nice to no be restful for these ajax items some times
though. For example i mentioned auto_complete today and now is a
requirement, nice one!! These also fail under similar circumstances (no
route found etc)
=========================VIEW CODE START
<span id=“<%= “#{dom_id(track)}_artist” %>”><%= track.artist %>
<%= in_place_editor “#{dom_id(track)}_artist”, {:url =>
url_for(track_path(track)), :method=>:put} %>
=========================VIEW CODE END
=========================ERROR START
The page at http://0.0.0.0:3000 says:
.
.
.
error communicating with the server
Action controller :exception caught
Routing Error
no route found to match "e;/tracks/17& quote; with
{:method=&=gt;:post}
=========================ERROR END
=========================ROUTES START
ActionController::Routing::Routes.draw do |map|
map.resources :tracks, :prices, :attachments
map.connect ‘’, :controller => “releases”
end
=========================ROUTES END