Ron
2008-Mar-07 15:45 UTC
What''s the most compelling way to do AJAX/Interactive applications with Rails?
Hi, So as I''ve said before, I''m coming to Rails from ColdFusion. In ColdFusion 8, there is are strong, albeit somewhat templated AJAX features. What sort of options are out there for AJAX with Rails? Thanks, Ron --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Eric Hill
2008-Mar-07 17:47 UTC
Re: What''s the most compelling way to do AJAX/Interactive applications with Rails?
Ron wrote:> What sort of options are out there for AJAX with Rails?http://www.google.com/search?q=rails+ajax "Lots" --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Nathan Esquenazi
2008-Mar-08 13:30 UTC
Re: What''s the most compelling way to do AJAX/Interactive ap
The "keyword" you may want to look into is "rjs templates". These are ruby templates that allow you to "render" ajax actions and javascript effects. Other useful keywords to look into: - remote_form_for - form_remote_tag - link_to_remote - observe_form - observe_field Also, look here: http://api.rubyonrails.org/classes/ActionView/Helpers/PrototypeHelper/JavaScriptGenerator/GeneratorMethods.html http://api.rubyonrails.org/classes/ActionView/Helpers/PrototypeHelper.html It may take a little bit of time to become familiar but it is surprisingly easy to use javascript and ajax rails. # /app/controllers/posts_controller.rb def create @post = Post.new(params[:post]) respond_to do |format| if @post.save format.js # renders create.js.rjs template else #... end end end # /app/views/posts/create.js.rjs page.insert_html :bottom, ''posts-list'', :partial => "post_item", :object => @post That is a quick example of how easy it is to set up an rjs action. That is the basic code for having someone create a post which shows up on screen using ajax to load the new post. -- 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 -~----------~----~----~----~------~----~------~--~---
Marlon Moyer
2008-Mar-11 17:09 UTC
Re: What''s the most compelling way to do AJAX/Interactive applications with Rails?
Hi Ron, coming from CF myself, I''ve faced the same issues. I originally tried using RJS (baked into rails), but it left me with the same feeling of using cfform tags. I''m also a fan of unobtrusive javascript and I couldn''t find an easy way to use those principles with rjs. Currently, I''m creating a new app that uses dojo toolkit. It''s an app all done on one page (the public/index.html file) that uses all the rails controllers as json providers. I like not being tied to one library. On Mar 7, 2008, at 9:45 AM, Ron wrote:> > Hi, > > So as I''ve said before, I''m coming to Rails from ColdFusion. In > ColdFusion 8, there is are strong, albeit somewhat templated AJAX > features. > > What sort of options are out there for AJAX with Rails? > > Thanks, > > Ron > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Nathan Esquenazi
2008-Mar-11 23:44 UTC
Re: What''s the most compelling way to do AJAX/Interactive ap
Definately check out: http://ujs4rails.com/ Unobstrusive Javascript for Rails. Awesome plugin that allows for applying those principles with rjs. -- 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 -~----------~----~----~----~------~----~------~--~---
Peter De Berdt
2008-Mar-11 23:48 UTC
Re: What''s the most compelling way to do AJAX/Interactive ap
On 12 Mar 2008, at 00:44, Nathan Esquenazi wrote:> Definately check out: > > http://ujs4rails.com/ > > Unobstrusive Javascript for Rails. Awesome plugin that allows for > applying those principles with rjs.It''s not supported anymore, Dan Webb posted his reasons and he''s perfectly right. Use LowPro instead and do it in Javascript itself. Using Rails 2 it''s perfectly possible to generate javascript with erb parsing and combining that with LowPro, you have a pretty powerful tool at hand. Best regards Peter De Berdt --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---