Hi, I would like to use checkboxes in a list without enclosing them in a form and: 1. Save interactions to the database 2. Change the appearance of the <li> when checked/unchecked Also, I would like this done without reloading the <li>. Is this possible? Thanks! -- 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 -~----------~----~----~----~------~----~------~--~---
Sure you can do that. You will need a combination of JavaScript, DHTML, AJAX. You will need AJAX to accomplish #1 requirement to make a remote call to the server. You only need DHTML driven by JavaScript to accomplish #2. On Oct 3, 1:45 pm, Gus Vs <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hi, I would like to use checkboxes in a list without enclosing them in a > form and: > > 1. Save interactions to the database > 2. Change the appearance of the <li> when checked/unchecked > > Also, I would like this done without reloading the <li>. Is this > possible? Thanks! > -- > Posted viahttp://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 will need AJAX to accomplish #1 requirement to make a remote call > to the server. You only need DHTML driven by JavaScript to accomplish > #2.Thanks! Is there any way to accomplish this using Rails-helpers? -- 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 4 Oct 2007, at 11:04, Gus Vs wrote:> >> You will need AJAX to accomplish #1 requirement to make a remote call >> to the server. You only need DHTML driven by JavaScript to accomplish >> #2. > Thanks! Is there any way to accomplish this using Rails-helpers?off the top of my head you want something like check_box_tag(''enabled'', ''1'', is_enabled?, :onchange => remote_function( :url => {:action => ''checkbox changed''})) If you don''t need server interaction, replace remote_function with the javascript of your choice. You can use update_page if you want to generate the javascript via an rjs like syntax rather than writing it by hand. Fred> > -- > 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 -~----------~----~----~----~------~----~------~--~---
OK, I think this is related to something I''m trying to do.... I have bunch of JSON data that gets loaded onLoad and displayed. I''d like to have a set of checkboxes that I can use to dynamically exclude/ include certain subsets of the data with. I''m sure this should be pretty simple... but I''m new. Could someone point me to any examples, etc.? thanx, skwasha On Oct 4, 4:48 am, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 4 Oct 2007, at 11:04, Gus Vs wrote: > > > > >> You will need AJAX to accomplish #1 requirement to make a remote call > >> to the server. You only need DHTML driven by JavaScript to accomplish > >> #2. > > Thanks! Is there any way to accomplish this using Rails-helpers? > > off the top of my head you want something like > > check_box_tag(''enabled'', ''1'', is_enabled?, :onchange => > remote_function( :url => {:action => ''checkbox changed''})) > > If you don''t need server interaction, replace remote_function with > the javascript of your choice. You can use update_page if you want to > generate the javascript via an rjs like syntax rather than writing it > by hand. > > Fred > > > > > -- > > Posted viahttp://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 -~----------~----~----~----~------~----~------~--~---