8

I am planning to use jquery in Rails instead of prototype.

I am not sure to use jRails or to use plain jquery and stay away from RJS.

What do you think about this?

EDIT: Two weeks later I found this http://www.loudthinking.com/posts/32-myth-3-rails-forces-you-to-use-prototype

EDIT: This screencast is interesting too.

0

5 Answers 5

6

If you ask me, staying away from RJS is a great idea. RJS is an amazingly cool hack, but for production code it's a pain to test and debug. I recommend sticking to UJS (Unobtrusive JavaScript), and jQuery is a great way to do UJS.

Sign up to request clarification or add additional context in comments.

Comments

2

I second using jQuery without the help of Rails using unobtrusive Javascript as a technique. I would recommend using the Low Pro library to set up behavior controllers to bind CSS pseudo-classes (events) to your functions.

jQuery also does just fine without Rails for DOM manipulation.

Comments

1

I use JRails and it is exc ellent.

I think there is some value to be hand with using RJS for simple operations ... much of the out-of-the-box functionality works great for simple use-cases and it helps you get a finished product out the door fast. You can always convert code at a later stage.

Comments

0

JRails did not work out of the box for me when i was migrating Rails 3+RJS from Prototype to JQuery. So i just did monkey-patching with fragment of JRails not using the rest of it, like described here

Comments

-7

Prototype and Scriptaculous are parts of Rails framework. IMHO, you can remove these libraries and insert others but then it will be not Rails framework and Rails project.

The other variant is to add jQuery to the standard Rails configuration. After that you have to fix few compatibility problems between these libraries. jQuery have published small script that make it.

2 Comments

as with any framework, you don't have to use all the features including rails' support for prototype/scripty. so it doesn't follow that removing proto/script from rails means it's no longer rails.
if you are not using prototype, scriptauclous, REST, MVC ideas, partials and migrations then it is NOT Rails at all.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.