# CGI library for Ruby

**URL:** <https://rubytalk.org/t/cgi-library-for-ruby/24078>\
**Category:** ruby-talk\
**Created:** [13 January 2006 03:13 UTC](https://rubytalk.org/t/cgi-library-for-ruby/24078 "2006-01-13T03:13:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Salvatore\_Sanfilippo](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@Salvatore\_Sanfilippo](https://rubytalk.org/u/Salvatore_Sanfilippo)\
**Post date:** [13 January 2006 03:13 UTC](https://rubytalk.org/t/cgi-library-for-ruby/24078/1 "2006-01-13T03:13:05Z")

</div>

Hello!

I want to port a web application to Ruby. I know about Ruby on Rails  
and  
other powerful frameworks but this project is simple enough and I'm new  
enough to Ruby that all I want is a reliable CGI library with a very  
sane  
API. All the features I need is access to GET/POST parameters, cookies  
handling,  
file upload support. Sessions are not required.

May you please suggest one?

Thank you very much for your help,  
Salvatore

---

<div class="post-metadata">

**Author:** ![Kev\_Jackson2](https://avatars.discourse-cdn.com/v4/letter/k/7ea924/32.png) [@Kev\_Jackson2](https://rubytalk.org/u/Kev_Jackson2)\
**Post date:** [13 January 2006 03:25 UTC](https://rubytalk.org/t/cgi-library-for-ruby/24078/2 "2006-01-13T03:25:37Z")

</div>

Salvatore Sanfilippo wrote:

> Hello!
> 
> I want to port a web application to Ruby. I know about Ruby on Rails  
> and  
> other powerful frameworks but this project is simple enough and I'm new  
> enough to Ruby that all I want is a reliable CGI library with a very  
> sane  
> API. All the features I need is access to GET/POST parameters, cookies  
> handling,  
> file upload support. Sessions are not required.
> 
> May you please suggest one?
> 
> Thank you very much for your help,  
> Salvatore

CGI is a core/standard library in Ruby. Look in the Pickaxe 2 book for an example of it being used

Kev

---

<div class="post-metadata">

**Author:** ![Collins\_Justin](https://avatars.discourse-cdn.com/v4/letter/c/e19adc/32.png) [@Collins\_Justin](https://rubytalk.org/u/Collins_Justin)\
**Post date:** [13 January 2006 20:53 UTC](https://rubytalk.org/t/cgi-library-for-ruby/24078/3 "2006-01-13T20:53:51Z")

</div>

And here's the link:

[http://ruby-doc.org/stdlib/libdoc/cgi/rdoc/index.html](http://ruby-doc.org/stdlib/libdoc/cgi/rdoc/index.html)

The CGI library supports cookies and sessions pretty much transparently, as well as including nearly all the HTML generation methods you would need.

-Justin

Kev Jackson wrote:

> **···**
>
> > Salvatore Sanfilippo wrote:
> > 
> > > Hello!
> > > 
> > > I want to port a web application to Ruby. I know about Ruby on Rails  
> > > and  
> > > other powerful frameworks but this project is simple enough and I'm new  
> > > enough to Ruby that all I want is a reliable CGI library with a very  
> > > sane  
> > > API. All the features I need is access to GET/POST parameters, cookies  
> > > handling,  
> > > file upload support. Sessions are not required.
> > > 
> > > May you please suggest one?
> > > 
> > > Thank you very much for your help,  
> > > Salvatore
> > 
> > CGI is a core/standard library in Ruby. Look in the Pickaxe 2 book for an example of it being used
> > 
> > Kev

---

<div class="post-metadata">

**Author:** ![Jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@Jules](https://rubytalk.org/u/Jules)\
**Post date:** [13 January 2006 21:37 UTC](https://rubytalk.org/t/cgi-library-for-ruby/24078/4 "2006-01-13T21:37:19Z")

</div>

Justin Collins wrote:

> And here's the link:
> 
> [http://ruby-doc.org/stdlib/libdoc/cgi/rdoc/index.html](http://ruby-doc.org/stdlib/libdoc/cgi/rdoc/index.html)
> 
> The CGI library supports cookies and sessions pretty much transparently,  
> as well as including nearly all the HTML generation methods you would  
> need.
> 
> -Justin

And you could use ERB templates to generate HTML.

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).
