[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

How can I develop a Web Application using ruby without rails

Pradeep Belagapu

3/25/2008 1:10:00 PM

I have an idea about developing web application using Ruby on Rails.
But I don't know how to develop a web application using only ruby
without rails. Is it possible? If possible how can I handle requests,
actions, responses etc., Please clear my doubt as early as possible.


Thanks

Pradeep Kumar
--
Posted via http://www.ruby-....

5 Answers

Robert Klemme

3/25/2008 1:18:00 PM

0

2008/3/25, Pradeep Belagapu <pradeep@invivosoft.com>:
> I have an idea about developing web application using Ruby on Rails.
> But I don't know how to develop a web application using only ruby
> without rails. Is it possible? If possible how can I handle requests,
> actions, responses etc., Please clear my doubt as early as possible.

You can use CGI and there is a class with the same name that helps you
process requests and create responses.

Then there are various other mechanisms like FastCGI etc.

Kind regards

robert

--
use.inject do |as, often| as.you_can - without end

M. Edward (Ed) Borasky

3/25/2008 1:39:00 PM

0

Pradeep Belagapu wrote:
> I have an idea about developing web application using Ruby on Rails.
> But I don't know how to develop a web application using only ruby
> without rails. Is it possible? If possible how can I handle requests,
> actions, responses etc., Please clear my doubt as early as possible.
>
>
> Thanks
>
> Pradeep Kumar

Iowa ... Nitro ... roll your own


Vidar Hokstad

3/25/2008 1:58:00 PM

0

On Mar 25, 1:09 pm, Pradeep Belagapu <prad...@invivosoft.com> wrote:
>    I have an idea about developing web application using Ruby on Rails.
> But I don't know how to develop a web application using only ruby
> without rails. Is it possible? If possible how can I handle requests,
> actions, responses etc., Please clear my doubt as early as possible.

Look at Rack: http://rack.ruby...

It gives you a thin web-server independent layer that also tie in
nicely with a large number of frameworks, and at the same time is
simple enough that you can trivially write an application without a
framework if you prefer. The code I run my site and my blog on at
http://www.ho... is built using only Rack and no framework,
combined with various self contained libraries, for example so it's
absolutely doable.

Vidar

Zoltan Dezso

3/25/2008 2:56:00 PM

0

Pradeep Belagapu wrote:
> I have an idea about developing web application using Ruby on Rails.
> But I don't know how to develop a web application using only ruby
> without rails. Is it possible? If possible how can I handle requests,
> actions, responses etc., Please clear my doubt as early as possible.
>
>
> Thanks
>
> Pradeep Kumar

Hi,

I am currently developing Ruby (not rails) web applications for mobile
phones - so yes, you don't need rails.

To get some basic information about the cgi version, i recommend
starting here:
http://www.ruby-doc.org/docs/ProgrammingRuby/htm...

You can get information about eruby and mod_ruby (for apache) from this
site:
http://modru...

These are not frameworks, they just execute ruby code. If you are using
apache, it is fairly straightforward to set up the eruby executable to
handle your requests for you and you just basically embed ruby inside
html like this:
<div>This is HTML</div>
<% print "this is ruby" %>
etc.
A tutorial can be found here: http://www.hiveminds.co.uk...

With mod_ruby or fastcgi, you can get even more control over the
response, you can create a small ruby program that catches the request
and generates the whole response.

print "HTTP/1.1 200 OK\n"
print "Content-Type: text/plain\n\n"
print 'Static text.'

is a very simple handler that just displays that static text. Of course,
as Robert mentioned before, you can use CGI to help you, like:
require 'cgi'
c = CGI.new
print c.header('type'=>'text/plain')
print 'Static text.'

Hope this helps.

Zaki
--
Posted via http://www.ruby-....

Jeremy McAnally

3/25/2008 3:06:00 PM

0

Take look at my framework named vintage (it's on Rubyforge). That
uses Rack to create a rather barebones web framework. It'd probably
be a good starting point to learn from or use directly.

--Jeremy

On Tue, Mar 25, 2008 at 9:09 AM, Pradeep Belagapu
<pradeep@invivosoft.com> wrote:
> I have an idea about developing web application using Ruby on Rails.
> But I don't know how to develop a web application using only ruby
> without rails. Is it possible? If possible how can I handle requests,
> actions, responses etc., Please clear my doubt as early as possible.
>
>
> Thanks
>
> Pradeep Kumar
> --
> Posted via http://www.ruby-....
>
>



--
http://jeremymca...
http:...

Read my books:
Ruby in Practice (http://manning.com...)
My free Ruby e-book (http://humblelittlerub...)

Or, my blogs:
http://mrneig...
http://rubyinpr...