# Basic Rails questions

**URL:** <https://discuss.rubyonrails.org/t/basic-rails-questions/49676>\
**Category:** rubyonrails-talk\
**Created:** [February 25, 2010, 1:51pm UTC](https://discuss.rubyonrails.org/t/basic-rails-questions/49676 "2010-02-25T13:51:39Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hussein\_B](https://avatars.discourse-cdn.com/v4/letter/h/a4c791/32.png) [@Hussein\_B](https://discuss.rubyonrails.org/u/Hussein_B)\
**Post date:** [February 25, 2010, 1:51pm UTC](https://discuss.rubyonrails.org/t/basic-rails-questions/49676/1 "2010-02-25T13:51:39Z")

</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:** ![Andy\_Jeffries1](https://avatars.discourse-cdn.com/v4/letter/a/cab0a1/32.png) [@Andy\_Jeffries1](https://discuss.rubyonrails.org/u/Andy_Jeffries1)\
**Post date:** [February 25, 2010, 3:10pm UTC](https://discuss.rubyonrails.org/t/basic-rails-questions/49676/2 "2010-02-25T15:10:33Z")

</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](http://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:** ![11155](https://avatars.discourse-cdn.com/v4/letter/1/d26b3c/32.png) [@11155](https://discuss.rubyonrails.org/u/11155)\
**Post date:** [February 25, 2010, 3:50pm UTC](https://discuss.rubyonrails.org/t/basic-rails-questions/49676/3 "2010-02-25T15:50:58Z")

</div>

> Yes, use jRails plugin and it replaces all the helpers you're used to to use jQuery instead.

&nbsp;&nbsp;&nbsp;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://avatars.discourse-cdn.com/v4/letter/h/a4c791/32.png) [@Hussein\_B](https://discuss.rubyonrails.org/u/Hussein_B)\
**Post date:** [February 25, 2010, 4:08pm UTC](https://discuss.rubyonrails.org/t/basic-rails-questions/49676/4 "2010-02-25T16:08:15Z")

</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:** ![11155](https://avatars.discourse-cdn.com/v4/letter/1/d26b3c/32.png) [@11155](https://discuss.rubyonrails.org/u/11155)\
**Post date:** [February 26, 2010, 2:01am UTC](https://discuss.rubyonrails.org/t/basic-rails-questions/49676/5 "2010-02-26T02:01:07Z")

</div>

Sijo k g wrote:

> &nbsp;&nbsp;&nbsp;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.

---

<div class="post-metadata">

**Author:** ![Andy\_Jeffries1](https://avatars.discourse-cdn.com/v4/letter/a/cab0a1/32.png) [@Andy\_Jeffries1](https://discuss.rubyonrails.org/u/Andy_Jeffries1)\
**Post date:** [February 26, 2010, 3:11pm UTC](https://discuss.rubyonrails.org/t/basic-rails-questions/49676/6 "2010-02-26T15:11:55Z")

</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
