Once again I go to the RoR group for help. I have an application that is completely RESTful. I have a formatted call to one of my resources that is; format.js and it calls and RJS file that reloads all the partials on the page and displays some new information. ( in this case it''s service tickets, and when I click on a specific radio box it loads some different tickets ) My problem is that it would seem that Will Paginate makes use of calling tickets.js when it''s trying to paginate through the tickets... and the format.js line in my index action for the tickets controller is causing the pagination not to work... instead I get a ton of Javascript on the screen. If I remove the format.js line from the index action, the pagination works... but then my radio buttons don''t cause the AJAX reload. My question is, how can I get around this? Should I make a new formatted type for the AJAX call, or is there some other way of getting around this. like if it''s will paginate, then format.js returns the next 10 tickets and if it''s the radio box calling format.js then it runs the index.rjs file? Maybe through params? Any help would be appreciated. Thanks --~--~---------~--~----~------------~-------~--~----~ 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... apparently I''m not paying attention... Everything works fine UNTIL I make a RJS call by clicking on the radio boxes.. then the will paginate links change from "ticket" to "ticket.js". I was reading this post http://railsforum.com/viewtopic.php?pid=67434 and it seems I have a similar problem... however... putting <%= will_paginate @tickets, :params => { :action => "index"} %> made little difference,and the links still change from ticket to ticket.js Any ideas guys? On Aug 1, 12:17 pm, sw0rdfish <san...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Once again I go to the RoR group for help. > > I have an application that is completely RESTful. I have a formatted > call to one of my resources that is; > > format.js > > and it calls and RJS file that reloads all the partials on the page > and displays some new information. ( in this case it''s service > tickets, and when I click on a specific radio box it loads some > different tickets ) > > My problem is that it would seem that Will Paginate makes use of > calling tickets.js when it''s trying to paginate through the > tickets... and the format.js line in my index action for the tickets > controller is causing the pagination not to work... instead I get a > ton of Javascript on the screen. > > If I remove the format.js line from the index action, the pagination > works... but then my radio buttons don''t cause the AJAX reload. > > My question is, how can I get around this? Should I make a new > formatted type for the AJAX call, or is there some other way of > getting around this. like if it''s will paginate, then format.js > returns the next 10 tickets and if it''s the radio box calling > format.js then it runs the index.rjs file? Maybe through params? > > Any help would be appreciated. > > Thanks--~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
Sorry for the spam... For google-foo and internet archivations I''ll post the solition here... just change the will paginate block to <%= will_paginate @tickets, :params => { :format => "html"} %> which updates the format parameter to "html" and makes the linke tickets.html, instead of .js and all is well. Sorry again for the spam.. I wasted so much time mucking around with it, figures when I finally go to the well, the solution comes to me. On Aug 1, 12:30 pm, sw0rdfish <san...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> OK... apparently I''m not paying attention... > > Everything works fine UNTIL I make a RJS call by clicking on the radio > boxes.. then the will paginate links change from "ticket" to > "ticket.js". > > I was reading this posthttp://railsforum.com/viewtopic.php?pid=67434 > and it seems I have a similar problem... however... putting > <%= will_paginate @tickets, :params => { :action => "index"} %> > made little difference,and the links still change from ticket to > ticket.js > > Any ideas guys? > > On Aug 1, 12:17 pm, sw0rdfish <san...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Once again I go to the RoR group for help. > > > I have an application that is completely RESTful. I have a formatted > > call to one of my resources that is; > > > format.js > > > and it calls and RJS file that reloads all the partials on the page > > and displays some new information. ( in this case it''s service > > tickets, and when I click on a specific radio box it loads some > > different tickets ) > > > My problem is that it would seem that Will Paginate makes use of > > calling tickets.js when it''s trying to paginate through the > > tickets... and the format.js line in my index action for the tickets > > controller is causing the pagination not to work... instead I get a > > ton of Javascript on the screen. > > > If I remove the format.js line from the index action, the pagination > > works... but then my radio buttons don''t cause the AJAX reload. > > > My question is, how can I get around this? Should I make a new > > formatted type for the AJAX call, or is there some other way of > > getting around this. like if it''s will paginate, then format.js > > returns the next 10 tickets and if it''s the radio box calling > > format.js then it runs the index.rjs file? Maybe through params? > > > Any help would be appreciated. > > > Thanks--~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---