jRails vs. Prototype

后端 未结 3 1419
日久生厌
日久生厌 2021-02-08 10:11

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

相关标签:
3条回答
  • 2021-02-08 10:32

    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.

    0 讨论(0)
  • 2021-02-08 10:46

    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!

    0 讨论(0)
  • 2021-02-08 10:55

    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.

    0 讨论(0)
提交回复
热议问题