Observe_field, GET method and RESTful controllers

Hi all.

I am trying to work with restful rails and have come across a quandry
with observe_field.

I basically want the observe field to call a show action on a restful
controller. However I am unable to do so because I cannot get the damn
thing to use the get request properly. If I use the following:

<%= observe_field(“project_selector”, :update => “project_selector_div”,
:url => project_path, :with => “‘id=’+escape(value)”) %>

then the POST method is used and the controller thinks I am trying to
create a new record.

If I do the following:

<%= observe_field(“project_selector”, :update => “project_selector_div”,
:url => project_path, :method => :get, :with => “‘id=’+escape(value)”)
%>

Then the index action is called and Mongrel shows the following
wierdness in the log file

Processing ProjectsController#index (for 127.0.0.1 at 2006-10-18
23:29:13) [GET]
Session ID: cd6a0a059f38a78c07376123512967e1
Parameters: {“action”=>“index”, “id”=>“3”, “controller”=>“projects”,
“_”=>nil}
e[4;36;1mProject Load (0.000000)e[0m e[0;1mSELECT * FROM projects
e[0m

As you can see adding the :method => get appears to work but then the
:actoion is changed to index and there is a “_” +> nil parameter?

Does anyone have any suggestions on how to get observe_field to call the
show action using the GET method?

Many thanks

RJ

As you can see adding the :method => get appears to work but then the
:actoion is changed to index and there is a “_” +> nil parameter?

Does anyone have any suggestions on how to get observe_field to call the
show action using the GET method?

Many thanks

RJ

Have been messing around with this with no luck. With the introduction
of RESTful rails I am thinking that maybe a lot of the javascript stuff
needs to be updated to include the option to set the request methods
since the method counts in REST.

RJ

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs