How can I develop a Web Application using ruby without rails

P

Pradeep Belagapu

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
 
R

Robert Klemme

2008/3/25 said:
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
 
M

M. Edward (Ed) Borasky

Pradeep said:
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
 
V

Vidar Hokstad

   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.rubyforge.org/

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.hokstad.com/ is built using only Rack and no framework,
combined with various self contained libraries, for example so it's
absolutely doable.

Vidar
 
Z

Zoltan Dezso

Pradeep said:
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/html/web.html

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

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

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
 
J

Jeremy McAnally

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

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



--
http://jeremymcanally.com/
http://entp.com

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

Or, my blogs:
http://mrneighborly.com
http://rubyinpractice.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top