AJAX Support and Rails

Hello there,

This is my first post to the Ruby group. I am also new to the language and the Rails framework, it is an amazing place to be now. Coming from a PHP/ASP background I am glad something like Rails finally made it into web development.

Now to my question. I have been readying a lot about AJAX, and I wondered what kind of support is built-in into Rails for it. I read somewhere that Prototype or even Scriptaculous was somehow embedded into the Framework.

Could anyone elaborate on this? How do we use AJAX in a regular web application with Rails, where does the code go, and what is available?

Thanks a lot guys... any advice would be most welcome.

Best Regards,

Jose L. Hurtado Web Developer / IT Professional Toronto, Canada

Hi Jose,

check this out: http://api.rubyonrails.com/classes/ActionView/Helpers/ScriptaculousHelper.html http://api.rubyonrails.com/classes/ActionView/Helpers/PrototypeHelper.html

This is where most people get started. Well where I did.

Brad. http://www.pcast.com

Jose-Luis wrote:

Yan,

Thanks for the links! I will check them out.

Best Regards,

Jose L. Hurtado Web Developer / IT Professional Toronto, Canada

Brad,

Thanks for the link, it is a very good tutorial, I just started following it through.

It's nice to see most of what we need is already built in!

Best Regards,

Jose L. Hurtado Web Developer / IT Professional Toronto, Canada

Jan,

I forgot to mention, I was already looking at Scriptaculous, it is a very cool AJAX framework, and Ruby's support for it is another reason to use it.

By the way, the folks at Gucci used it to achieve a Flash-like AJAX version of their website, and it does look great, take a look here:

Jose L. Hurtado Web Developer / IT Professional Toronto, Canada

Just a note:

Scriptaculous is not Ajax, it’s just effects on DOM elements.

Prototype is the Ajax library.

Scriptaculous gives the effects that have come to be recognized as ‘Ajax’ (fade, blind, etc).

Jason

Jason,

Isn't this "difference" purely semantic.

From what I understood, Scriptaculous includes Prototype within their

own framework, so if you use Scriptaculous you are using Prototype anyway for the AJAX plumbing stuff, BUT it is included in the package. Am I right on this one? Or do you actually need to setup BOTH Prototype and Scriptaculous to make BOTH work. The way I understood it, was that Scripatculous was enough for full AJAX plus visual effects...

Jose L. Hurtado Web Developer / IT Professional Toronto, Canada