GUI for web application


I’m learning ruby on rails since from 2 days. Can anybody tell me how to
create GUI for web application? And where we have to write that code?
Did we have to write this in .rhtml file?


Hi Poonam.

I’m completely new to Ruby and Rails myself (only 2 weeks so far and
loving it), so here’s my understanding of how things work:

Rails ascribes to the MVC framework principle (Model-View-Controller).
Basically, the Model is your data model and also responsible for taking
care of business logic. The controllers act as the broker between the
model and the view and prepare the data for the views to display. The
views (templates) handle the display to the user. If you’re outputting
html, then your views would be .rhtml files. Other options include .rxml
for XML and .rjs for JavaScript. Most the time though, you’ll be dealing
with .rhtml templates as your views.

As references, so far I’m using three books that have been superb and I
highly recommend them:

  • Agile Web D. with Rails
  • Rails Recipes by Chad F.
  • Ruby for Rails by David A. Black

Best Regards,