Confused over best for views - RHTML, RJS, HAML, AS or MV?

Could someone please help make a clear recommendation? What would be the preferable method of developing Rails views? Uset to be RHTML. Now we've got RJS, HAML, AjaxScaffold, MasterView and that might not be the whole list. We're getting into Rails and would like to concentrate on the best method for generating and maintaining views. Thanks, Yitzhak

What would be the preferable method of developing Rails views?

it depends on what you want to do.

rhtml renders html. rjs renders javascript, etc. etc. You should use the tool that fits the job. But take the time to learn about what tools are available to you.

hth

"You should use the tool that fits the job." Yes, but what are the recommendations as to what the best tool is. I want Javascript, but there's RJS, AjaxScaffold, MasterView and Haml. Any recommendations?

It's not a question that can easily be answered. What makes sense to one person may seem uncomfortable and weird to another.

HAML is a good example. Once you get what all the symbols mean (and they have done a good job of keeping the distance between the HAML and HTML/CSS code short) it makes sense. To others the syntax is too far from RHTML, the learning curve to too steep, they don't have time, see the advantage or just don't want to switch brain-modes between ruby and haml all the time.

For me, RHTML allows me to stay in "ruby mode" and code the views. This suits by PHP background as it mixes <%%> tags with HTML (without all the logic, of course). The downside is I still need to ensure all the tags are closed, etc. I see HAML as the next step for me, and SASS will wake me from my CSS nightmare.

In the end, choose what feels right for you.

I have to agree with Andrew and Toby, each has its advantages, so it really depends on what you are looking for in a feature set and how you prefer to work. Learn about each one and try a few of them out and see what feels best to you.

For me, I created the MasterView project because I wanted a WYSIWYG editing capability but didn’t want to give up any of the power of ERB, layouts, and partials. If that is one of your needs then you might want to check it out. I’d be happy to answer any questions you have about it.

In the end though, it’s really what fits right for your style and needs.

Blessings,

Jeff

My three cents… Coming from a more HTML/CSS based background I found Haml to be a better fit. I understand the allure of the more Ruby templating systems but for me since the end result is going to be HTML, it makes more sense to use something more oriented around it. Plus it’s hella sexy. But the point that I think we’re all making is that there’s no one right choice. If you’ve never used any of the choices perhaps it’s best though to give the default ERb/RHTML a try. Since most of the documentation everywhere assumes you’ll be using that. Then, once you’re more comfortable, you might try some other ones. Might I suggest the lean and lovely Haml??

RSL