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}
[4;36;1mProject Load (0.000000) [0;1mSELECT * FROM projects
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
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk
-~----------~----~----~----~------~----~------~--~---