I'm starting my first Ruby on Rails project as I've been excited about the language for quite a while now and I'm sick of writing PHP. I've gathered that rails is pretty much an automation framework which should really speed up programming on the backend for me. Though this does not impact the frontend, I still need to write tables, styles and div's to put my layout together.

I know there's libraries like ExtJS out there that automate a big part of this process but I was wondering if there's any frameworks out there that actually integrate with Ruby on Rails, as in, offer a build-in way to handle ajax queries for example.

TLDR: I would really appreciate some tips on a good JS framework to go with Ruby on Rails.

  • Why tag Ruby? Ruby != Rails
    – Nakilon
    Jan 22 '11 at 7:13
  • ok I don't know much about rails but I'm fairly certain it's a framework based on Ruby, like Codeigniter or CakePHP are to php. So how is it not Ruby anymore?
    – Naatan
    Jan 22 '11 at 16:06

Prototype comes built into Rails, and with it you can do things like write Ruby that gets compiled to Javascript (I think they call it RJS in the Rails world).

Though really, you can use any JS framework you want with it. I'll always stick with jQuery.

  • +1 for jQuery. I would steer away from "native language" to JavaScript compilers. JavaScript isn't bad.
    – Jeremy
    Jan 22 '11 at 2:18
  • Thanks, I did not know Rails came with a JS framework build in. However I'm looking something more along the lines of extjs or gwt but with build in support for RoR. I realize there's a small chance this exists but I'll never know if I don't ask.
    – Naatan
    Jan 22 '11 at 4:38

Jquery, prototype, etc.

You can't compare them unless you tell us what you need to do, to be exact I would chose to make my own, the only JavaScript you should use is Ajax but don't depend on it to heavily (keep in mind of SEO), then you may want to do some animations, css3 (webkit is great for native css3 animations) and if not available then use JavaScript, JavaScript should be last resort, though when it is there using it can be fun.

In other words write your own, though as you are going for RoR you seem to want things to be simple, so JQuery wins :)

  • Thanks, I'm making an app that will only be used by specific people with authorized access so SEO isn't of importance to me. And in this day and age I think you can assume that 99.99% of your visitors have a javascript capable browser, frankly I don't care for those who dont. I am quite experienced in jQuery but I am looking for something that is more automated, all I want to worry about is what type of element I want to display, not how that element is made up.
    – Naatan
    Jan 22 '11 at 4:32
  • I have to say that JQuery would have to be the best option for you, extjs is something that I seriously demote as it is a huge library that takes tones of javascript to do something that would take me a few hours to write my own library for any needs I have, my CMS contains one small section of javascript (before plugins add to it) that currently is using JQuery but soon It will not, Though my plugins are kindof tuned to jquery I will change it back to my own $(a,b) function just running (b?$(b):document).querySelectorAll(a); Simple and it does the job,... Jan 22 '11 at 7:13
  • I will also run $.prototype = {...} Jan 22 '11 at 7:34

Have a look at Mootools if you want to use javascript OO style and lightweight effects, handy ajax sending and loading, form validation, etc...

  • Thanks, Mootools looks interesting.. I definitely like it's OO style. But beyond that it looks pretty much like it does the exact same as jQuery.
    – Naatan
    Jan 22 '11 at 18:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.