Skip to content Skip to sidebar Skip to footer

Jrails Vs. Prototype

I am not trying to make this a preference question, I am really wondering what people's experiences are with using jQuery and Rails or jRails for development. Most rails users inc

Solution 1:

In Rails it really all comes down to the helper methods. Are you using any prototype helper methods? If so then you must use jRails to switch to jQuery. But if not then it really does not matter. They are both great. I used prototype a lot before and it is great. But I prefer the selector way of doing things with jQuery so I have switched. Another good reason to not use the helper methods is unobtrusive javascript. The rails helper methods creates messy inline code.

Solution 2:

jRails is great if you are using rjs templates if you want to maintain a "consistent" codebase between generated and handwritten. However, I personally have seen jRails not know how to really decently handle ajax form generators.

My biggest recommendation is to have jRails for "when you need it", and get more comfortable with writing JavaScript by hand. Prototype and jQuery are really two completely different schools of thought, and they aren't necessarily compatible. At first, I was a huge Prototype advocate, because a ton of my Ruby design knowledge was transferable, however I have learned to use jQuery in a much more robust way, using jQuery to empower more natural JavaScript.

Solution 3:

Do you use prototype for things other then the rjs files and other javascript helpers? If so then you will need to determine if you want to rewrite thoose in jQuery. Otherwise, you can just use jRails to take care of any rjs helpers and you will not even notice a difference.

I have been using jRails and love it!

Post a Comment for "Jrails Vs. Prototype"