Hi there, I have the following code in my view: <%= check_box_tag ''checkopen'', 1, params[:checkopen] == ''1'', :onclick => remote_function( :url => {:action => ''index'') %>Open Now But for some reason whenever the box is checked it calls the create action instead of the index action. Any ideas what''s going on? Thanks, steve -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 8 Apr 2008, at 19:37, Steve Glaz wrote:> > Hi there, > > > I have the following code in my view: > > <%= check_box_tag ''checkopen'', 1, params[:checkopen] == ''1'', > :onclick => remote_function( :url => {:action => ''index'') %>Open Now > > But for some reason whenever the box is checked it calls the create > action instead of the index action. Any ideas what''s going on? >Does the html/javascript generated look ok ? Fred> Thanks, > steve > -- > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
You can try passing the get method for the remote call. <%= check_box_tag ''checkopen'', 1, params[:checkopen] == ''1'', :onclick => remote_function( :url => {:action => ''index''}, :method => ''get'') %>Open Now I am not sure which method should be used. Try with get and post. And it will be better if u specify the controller name also in the url. -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
It''s (probably) because he''s using restful routes. Julian Learn Ruby on Rails! Check out the FREE VIDS (for a limited time) VIDEO #3 out NOW! http://sensei.zenunit.com/ On 09/04/2008, at 7:07 AM, Frederick Cheung wrote:> > > On 8 Apr 2008, at 19:37, Steve Glaz wrote: > >> >> Hi there, >> >> >> I have the following code in my view: >> >> <%= check_box_tag ''checkopen'', 1, params[:checkopen] == ''1'', >> :onclick => remote_function( :url => {:action => ''index'') %>Open Now >> >> But for some reason whenever the box is checked it calls the create >> action instead of the index action. Any ideas what''s going on? >> > Does the html/javascript generated look ok ? > > Fred >> Thanks, >> steve >> -- >> 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---