I have successfully set-up a link_to_remote so that it works (although I
had to replace the project_path URL with the :controller and :action) as
you can see above however I cannot for the life of me get the
observe_field to work. (Putting :method => ‘get’ into the :url hash
doesn’t work)
Looking at the API there is no html_options specified in the observe
field method so I am wondering if it is possible and I am missing
something or do I need to submit a ticket on edge rails to get all the
prototype helpers updated to allow a :method for RESTful compatibility.
I think that :method => ‘get’ is what you want - But it doesn’t need to
go in the :url hash. It should be just like link_to_remote, i.e.
observe_field(“project_selector”, :method => ‘get’, etc…)
The ajax prototype helpers end up calling options_for_ajax which is
clearly looking out for the presence of a method parameter.
I think that :method => ‘get’ is what you want - But it doesn’t need to
go in the :url hash. It should be just like link_to_remote, i.e.
observe_field(“project_selector”, :method => ‘get’, etc…)
The ajax prototype helpers end up calling options_for_ajax which is
clearly looking out for the presence of a method parameter.
Fred
Hoi Fred.
I was afraid that would be the answer When I do this (and have done
this in the past) the request seems to get screwed up as you can see
from the log below:
The request is correctly sent as a GET but the action gets changed to
“index” and a “_”=>nil parameter is created for some reason.
Before I started raising tickets I wanted to be sure it is a problem
with edge rather than me just not understanding the helpers. Does anyone
know what is causing this?
I’m stuck in the same problem with GET, observer_field and REST
controller with the “_” stuff (some days already
Have you got any solution or did you raised the ticket?
Priit
I have raised a ticket although the description is slightly different.
I believe the action is going to “index” because the “id” parameter in
:with is not honoured by the restful controller as a proper ID (in that
it doesn’t use the id value specified in the :with hash to construct the
URL which, with a restful get request, means that it goes to the index).
I am still a relative newbie so if you can add some better details it
will probably help