Thank You very much Aslak, Your explanation is very clear and I got the clear idea of rack.. Thank you once again.



On Thu, Aug 18, 2011 at 1:04 PM, aslak hellesoy <aslak.hellesoy@gmail.com> wrote:
On Thu, Aug 18, 2011 at 5:34 AM, Uma Mahesh Nyros
<nyros.umamahesh@gmail.com> wrote:
> Hi,
>
> I am new to rack. I have few baisc questions on it.
>
> Can I know the difference between normal rails application and rack
> application.? What are the uses of rack application? Why we need to
> use rack application ?

Rack is a small library that sits between your HTTP server (WEBrick,
Thin, Mongrel etc) and your higher level web framework (Rails).

[HTTP Server] <---> [Rack] <---> [Rails] <---> [Your app]

Rack translates HTTP requests to very simple and low level Ruby method
invocations. Likewise, it translates low level Ruby method invocations
back to a HTTP response.

It's possible to write a Ruby web application using Rack only, but
most people don't as it is too low level. (For the same reason that
most people prefer higher level programming languages over assembly or
C). Rack is designed to be a common HTTP server API for implementors
of Ruby web frameworks (such as Rails).

Rails is a web framework built on top of Rack, using Rack's Ruby API
to receive HTTP requests and send HTTP responses back. From a
developer perspective this allows you to write a web app using higher
level constructs (controllers, actions and views). From Rails'
perspective this means that Rails works with any HTTP server that has
a Rack interface.

Aslak

>
>
> Thank You,
> Uma Mahesh.
>
>