Hey,
I’m doing a little research regarding Rails, so please forgive my
questions.
Prototype is bundled with Rails, is it possible to employ jQuery
instead of Prototype?
If yes, how much it is hard to do so? does it require a lot of work?
or it is just like an eye blink?
Rails uses RHTML as templates, is it possible to use another one (like
Haml)?
Again, If yes, how much it is hard to do so? does it require a lot of
work? or it is just like an eye blink?
Thanks for help and time.
I’m doing a little research regarding Rails, so please forgive my
questions.
Always welcome to post questions (doesn’t mean you’ll like the
answers…
)
Prototype is bundled with Rails, is it possible to employ jQuery
instead of Prototype?
Yes, use jRails plugin and it replaces all the helpers you’re used to to
use
jQuery instead.
If yes, how much it is hard to do so? does it require a lot of work?
or it is just like an eye blink?
script/plugin install git://github.com/aaronchi/jrails.git
Done.
Rails uses RHTML as templates, is it possible to use another one (like
Haml)?
Yes (although technically since Rails 2 it uses .html.erb as templates).
Again, If yes, how much it is hard to do so? does it require a lot of
work? or it is just like an eye blink?
gem install haml
haml --rails /path/to/my/railsapp
Create new views using (action).html.haml instead of (action).html.erb
Done.
Cheers,
Andy
Yes, use jRails plugin and it replaces all the helpers you’re used to to
use
jQuery instead.
One is obtrusive(prototype) and other is unobtrusive. I think the
choice is jQuery. And You can use both at a time or either of two at a
time. For more details please refer
http://docs.jquery.com/Using_jQuery_with_Other_Libraries
Sijo
Thanks Andy,
This flexibility in choosing whatever you like is something new in
Rails right?
Because I read in the past about complains saying that Rails dictates
you and it doesn’t provide the flexibility to alter parts of the
default stack (like template technology or JavaScript library).
Thanks again.
This flexibility in choosing whatever you like is something new in
Rails right?
Sort of…
Because I read in the past about complains saying that Rails dictates
you and it doesn’t provide the flexibility to alter parts of the
default stack (like template technology or JavaScript library).
It’s always been possible, it’s not always been easy. With Rails 3 it’s
now
easy (well, relatively speaking).
However, jRails has been around for ages and they just did it the hard
way.
The Rails 3 choice should be easier.
And I agree with Robert’s comment regarding obtrusiveness.
Cheers,
Andy
Sijo k g wrote:
One is obtrusive(prototype) and other is unobtrusive. I think the
choice is jQuery. And You can use both at a time or either of two at a
time. For more details please refer
Prototype is not inherently obtrusive. Prototype can be used
unobtrusively just as easily as jQuery. It’s just that Rails’
implementation of the helpers is obtrusive.
As I understand it though, Rails 3.0 has fixed the obtrusiveness of
their helpers. Wether you use Prototype or jQuery has nothing to do with
the obtrusiveness of JavaScript frameworks.