# Basic Rails questions

**URL:** <https://www.ruby-forum.com/t/basic-rails-questions/184126>\
**Category:** Rails\
**Created:** [February 25, 2010, 3:45pm UTC](https://www.ruby-forum.com/t/basic-rails-questions/184126 "2010-02-25T15:45:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hussein\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/a4c791/32.png) [@Hussein\_B](https://www.ruby-forum.com/u/Hussein_B)\
**Post date:** [February 25, 2010, 3:45pm UTC](https://www.ruby-forum.com/t/basic-rails-questions/184126/1 "2010-02-25T15:45:43Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Hussein\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/a4c791/32.png) [@Hussein\_B](https://www.ruby-forum.com/u/Hussein_B)\
**Post date:** [February 25, 2010, 4:37pm UTC](https://www.ruby-forum.com/t/basic-rails-questions/184126/2 "2010-02-25T16:37:50Z")

</div>

> 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

---

<div class="post-metadata">

**Author:** ![Hussein\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/a4c791/32.png) [@Hussein\_B](https://www.ruby-forum.com/u/Hussein_B)\
**Post date:** [February 25, 2010, 4:50pm UTC](https://www.ruby-forum.com/t/basic-rails-questions/184126/3 "2010-02-25T16:50:58Z")

</div>

> 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](http://docs.jquery.com/Using_jQuery_with_Other_Libraries)

Sijo

---

<div class="post-metadata">

**Author:** ![Hussein\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/a4c791/32.png) [@Hussein\_B](https://www.ruby-forum.com/u/Hussein_B)\
**Post date:** [February 25, 2010, 5:09pm UTC](https://www.ruby-forum.com/t/basic-rails-questions/184126/4 "2010-02-25T17:09:27Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Hussein\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/a4c791/32.png) [@Hussein\_B](https://www.ruby-forum.com/u/Hussein_B)\
**Post date:** [February 26, 2010, 4:13pm UTC](https://www.ruby-forum.com/t/basic-rails-questions/184126/5 "2010-02-26T16:13:02Z")

</div>

> 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

---

<div class="post-metadata">

**Author:** ![Hussein\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/a4c791/32.png) [@Hussein\_B](https://www.ruby-forum.com/u/Hussein_B)\
**Post date:** [February 26, 2010, 3:01am UTC](https://www.ruby-forum.com/t/basic-rails-questions/184126/6 "2010-02-26T03:01:07Z")

</div>

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.
