I hope this comes out clearly - I *think* I want to try and degrade to the same URL (Ajax vs non-Ajax) It looks like (looking at a slide - http://codecite.com/presentation/ruby/rails/ajax_rails#22) the request goes into the same controller (makes sense so far) then the same partial gets called (here is where some confusion takes place) If JS is turned off , then I suppose the partial (the form) must have a submit button. I guess I can also do some type of dom id thing where if js is on button not there and if off, button there ? If JS is turned off, does using the form with the observe_form code intefere in any way ? Stuart -- http://en.wikipedia.org/wiki/Dark_ambient --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Oct 17, 12:36 pm, "Dark Ambient" <sambi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I hope this comes out clearly - > I *think* I want to try and degrade to the same URL (Ajax vs non-Ajax) > > It looks like (looking at a slide -http://codecite.com/presentation/ruby/rails/ajax_rails#22) > the request goes into the same controller (makes sense so far) > then the same partial gets called (here is where some confusion takes place) > > If JS is turned off , then I suppose the partial (the form) must have a > submit button. I guess I can also do some type of dom id thing where if js > is on button not there and if off, button there ? > If JS is turned off, does using the form with the observe_form code intefere > in any way ? > > Stuart > > --http://en.wikipedia.org/wiki/Dark_ambientYou can use ''responds_to'' or just ''request.xhr?'' to see if the request is a post, get, or ajax call and then respond accordingly. For example, if a submit was sent via a post, you could then redirect to a new page, while an ajax request would render an RJS template and update the original page. Is this what you are trying to do? _Kevin --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 10/17/06, _Kevin <kevin.olbrich-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > > > On Oct 17, 12:36 pm, "Dark Ambient" <sambi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > I hope this comes out clearly - > > I *think* I want to try and degrade to the same URL (Ajax vs non-Ajax) > > > > It looks like (looking at a slide - > http://codecite.com/presentation/ruby/rails/ajax_rails#22) > > the request goes into the same controller (makes sense so far) > > then the same partial gets called (here is where some confusion takes > place) > > > > If JS is turned off , then I suppose the partial (the form) must have a > > submit button. I guess I can also do some type of dom id thing where if > js > > is on button not there and if off, button there ? > > If JS is turned off, does using the form with the observe_form code > intefere > > in any way ? > > > > Stuart > > > > --http://en.wikipedia.org/wiki/Dark_ambient > > You can use ''responds_to'' or just ''request.xhr?'' to see if the request > is a post, get, or ajax call and then respond accordingly. > > For example, if a submit was sent via a post, you could then redirect > to a new page, while an ajax request would render an RJS template and > update the original page. > > Is this what you are trying to do? > > _KevinYes, that is the goal. However, right now my ajaxed form has no submit button, it has an observe_form in it. So not sure if that will work , as far as using the same form. This is my quandry. Stuart -- http://en.wikipedia.org/wiki/Dark_ambient --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Oct 17, 1:26 pm, "Dark Ambient" <sambi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 10/17/06, _Kevin <kevin.olbr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > On Oct 17, 12:36 pm, "Dark Ambient" <sambi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I hope this comes out clearly - > > > I *think* I want to try and degrade to the same URL (Ajax vs non-Ajax) > > > > It looks like (looking at a slide - > >http://codecite.com/presentation/ruby/rails/ajax_rails#22) > > > the request goes into the same controller (makes sense so far) > > > then the same partial gets called (here is where some confusion takes > > place) > > > > If JS is turned off , then I suppose the partial (the form) must have a > > > submit button. I guess I can also do some type of dom id thing where if > > js > > > is on button not there and if off, button there ? > > > If JS is turned off, does using the form with the observe_form code > > intefere > > > in any way ? > > > > Stuart > > > > --http://en.wikipedia.org/wiki/Dark_ambient > > > You can use ''responds_to'' or just ''request.xhr?'' to see if the request > > is a post, get, or ajax call and then respond accordingly. > > > For example, if a submit was sent via a post, you could then redirect > > to a new page, while an ajax request would render an RJS template and > > update the original page. > > > Is this what you are trying to do? > > > _KevinYes, that is the goal. However, right now my ajaxed form has no submit > button, it has an observe_form in it. So not sure if that will work , as far > as using the same form. This is my quandry. > > Stuart > > --http://en.wikipedia.org/wiki/Dark_ambientSo, if I follow you correctly, you want to use the AJAX methods unless JS is turned off. In that case you want it to degrade to a standard form with a submit button? One way to do this would be to let the page render with a button and then use AJAX or JS to remove the button. If no JS or AJAX, then it will stay there. _Kevin --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 10/17/06, _Kevin <kevin.olbrich-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > > > On Oct 17, 1:26 pm, "Dark Ambient" <sambi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > On 10/17/06, _Kevin <kevin.olbr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > > > > > > On Oct 17, 12:36 pm, "Dark Ambient" <sambi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > I hope this comes out clearly - > > > > I *think* I want to try and degrade to the same URL (Ajax vs > non-Ajax) > > > > > > It looks like (looking at a slide - > > >http://codecite.com/presentation/ruby/rails/ajax_rails#22) > > > > the request goes into the same controller (makes sense so far) > > > > then the same partial gets called (here is where some confusion > takes > > > place) > > > > > > If JS is turned off , then I suppose the partial (the form) must > have a > > > > submit button. I guess I can also do some type of dom id thing > where if > > > js > > > > is on button not there and if off, button there ? > > > > If JS is turned off, does using the form with the observe_form code > > > intefere > > > > in any way ? > > > > > > Stuart > > > > > > --http://en.wikipedia.org/wiki/Dark_ambient > > > > > You can use ''responds_to'' or just ''request.xhr?'' to see if the request > > > is a post, get, or ajax call and then respond accordingly. > > > > > For example, if a submit was sent via a post, you could then redirect > > > to a new page, while an ajax request would render an RJS template and > > > update the original page. > > > > > Is this what you are trying to do? > > > > > _KevinYes, that is the goal. However, right now my ajaxed form has no > submit > > button, it has an observe_form in it. So not sure if that will work , as > far > > as using the same form. This is my quandry. > > > > Stuart > > > > --http://en.wikipedia.org/wiki/Dark_ambient > > So, if I follow you correctly, you want to use the AJAX methods unless > JS is turned off. In that case you want it to degrade to a standard > form with a submit button? > > One way to do this would be to let the page render with a button and > then use AJAX or JS to remove the button. If no JS or AJAX, then it > will stay there.So until the button is pressed there is no way of knowing that the browser is JS enabled ? Stuart -- http://en.wikipedia.org/wiki/Dark_ambient --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---