[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

How to go from a ruby script to a working website?

Ralph Wood

10/16/2008 9:19:00 AM

As you've probably guessed by the title, total newbie here.

My main interest is developing web stuff, and for that I started
learning programming through PHP. However, I discovered Ruby and
immediately fell in love with it.

I started following Chris Pine's Learn to Program and with the knowledge
I got so far, I started building a few very simple programs of my own.
The thing is that they're all limited to the Terminal (I have a mac),
but what I really want is to use them through a web interface (inputs,
forms, submit, etc) so I can also experiment with Javascript/AJAX.

However, I have no clue how to do that and can't seem to find
information on it anywhere. It seems the only way to access Ruby
programs through a webpage is with the aid of frameworks like Rails and
Merb, and they seem like too much trouble for what would be a simple
one-page app. I guess could use Camping or only the Merb-core, but I
would like to understand exactly what I'm doing, and just basically be
able do it all by myself.

So, what am I missing? What is the link between .rb and .html?
--
Posted via http://www.ruby-....

8 Answers

Daniel N

10/16/2008 10:34:00 AM

0

On Thu, Oct 16, 2008 at 8:56 PM, Hoesel, Dani=EBl van <
Daniel.vanHoesel@getronics.com> wrote:

> You could use the Merb-core in combination with the passenger mod for
> Apache. That mod allows you to run rails and merb applications just like =
php
> applications. Just upload and go. And indeed you could use Rails, but it'=
s
> easier to start with a merb application.
>
> Example:
> http://www.modrails.com/documentation/Users%20guide....
>
> As you can see passenger mod supports multiple simple frameworks. So mayb=
e
> you could try one of those.
>
> Regards,
>
> Daniel
>
> -----Original Message-----
> From: esmero@gmail.com [mailto:esmero@gmail.com]
> Sent: donderdag 16 oktober 2008 11:19
> To: ruby-talk ML
> Subject: How to go from a ruby script to a working website?
>
> As you've probably guessed by the title, total newbie here.
>
> My main interest is developing web stuff, and for that I started
> learning programming through PHP. However, I discovered Ruby and
> immediately fell in love with it.
>
> I started following Chris Pine's Learn to Program and with the knowledge
> I got so far, I started building a few very simple programs of my own.
> The thing is that they're all limited to the Terminal (I have a mac),
> but what I really want is to use them through a web interface (inputs,
> forms, submit, etc) so I can also experiment with Javascript/AJAX.
>
> However, I have no clue how to do that and can't seem to find
> information on it anywhere. It seems the only way to access Ruby
> programs through a webpage is with the aid of frameworks like Rails and
> Merb, and they seem like too much trouble for what would be a simple
> one-page app. I guess could use Camping or only the Merb-core, but I
> would like to understand exactly what I'm doing, and just basically be
> able do it all by myself.
>
> So, what am I missing? What is the link between .rb and .html?
> --
> >

Using merb-core for a one page app is not a silly idea. You can use it wit=
h
a very_flat (1 file) merb application.

to genearte the stubs to get you going for this use

merb-gen very_flat my_app

then run it with

merb -I <app_file>

HTH
~Daniel

Trans

10/16/2008 12:29:00 PM

0



On Oct 16, 5:19=A0am, Ralph Wood <esm...@gmail.com> wrote:
> As you've probably guessed by the title, total newbie here.
>
> My main interest is developing web stuff, and for that I started
> learning programming through PHP. However, I discovered Ruby and
> immediately fell in love with it.
>
> I started following Chris Pine's Learn to Program and with the knowledge
> I got so far, I started building a few very simple programs of my own.
> The thing is that they're all limited to the Terminal (I have a mac),
> but what I really want is to use them through a web interface (inputs,
> forms, submit, etc) so I can also experiment with Javascript/AJAX.
>
> However, I have no clue how to do that and can't seem to find
> information on it anywhere. It seems the only way to access Ruby
> programs through a webpage is with the aid of frameworks like Rails and
> Merb, and they seem like too much trouble for what would be a simple
> one-page app. I guess could use Camping or only the Merb-core, but I
> would like to understand exactly what I'm doing, and just basically be
> able do it all by myself.
>
> So, what am I missing? What is the link between .rb and .html?

start with cgi.rb
learn about webrick
comprehend rack
all "explodes" from there

Jim McKerchar

10/16/2008 12:57:00 PM

0

Take a look at one of the frameworks that has been built on top of Ruby
such as Merb or Rails

Ralph Wood wrote:
> As you've probably guessed by the title, total newbie here.
>
> My main interest is developing web stuff, and for that I started
> learning programming through PHP. However, I discovered Ruby and
> immediately fell in love with it.
>
> I started following Chris Pine's Learn to Program and with the knowledge
> I got so far, I started building a few very simple programs of my own.
> The thing is that they're all limited to the Terminal (I have a mac),
> but what I really want is to use them through a web interface (inputs,
> forms, submit, etc) so I can also experiment with Javascript/AJAX.
>
> However, I have no clue how to do that and can't seem to find
> information on it anywhere. It seems the only way to access Ruby
> programs through a webpage is with the aid of frameworks like Rails and
> Merb, and they seem like too much trouble for what would be a simple
> one-page app. I guess could use Camping or only the Merb-core, but I
> would like to understand exactly what I'm doing, and just basically be
> able do it all by myself.
>
> So, what am I missing? What is the link between .rb and .html?
>
> ------------------------------------------------------------------------
>
>
> No virus found in this incoming message.
> Checked by AVG - http://w...
> Version: 8.0.173 / Virus Database: 270.8.1/1727 - Release Date: 15/10/2008 20:02
>
>


Brian Candler

10/16/2008 1:37:00 PM

0

Ralph Wood wrote:
> they seem like too much trouble for what would be a simple
> one-page app. I guess could use Camping or only the Merb-core, but I
> would like to understand exactly what I'm doing, and just basically be
> able do it all by myself.

For a one-pager app, look at Sinatra. I've only given it a quick try,
but it looks a lot cleaner and simpler than Camping.
--
Posted via http://www.ruby-....

Michael Guterl

10/16/2008 4:18:00 PM

0

On Thu, Oct 16, 2008 at 5:19 AM, Ralph Wood <esmero@gmail.com> wrote:
> As you've probably guessed by the title, total newbie here.
>
> My main interest is developing web stuff, and for that I started
> learning programming through PHP. However, I discovered Ruby and
> immediately fell in love with it.
>
> I started following Chris Pine's Learn to Program and with the knowledge
> I got so far, I started building a few very simple programs of my own.
> The thing is that they're all limited to the Terminal (I have a mac),
> but what I really want is to use them through a web interface (inputs,
> forms, submit, etc) so I can also experiment with Javascript/AJAX.
>
> However, I have no clue how to do that and can't seem to find
> information on it anywhere. It seems the only way to access Ruby
> programs through a webpage is with the aid of frameworks like Rails and
> Merb, and they seem like too much trouble for what would be a simple
> one-page app. I guess could use Camping or only the Merb-core, but I
> would like to understand exactly what I'm doing, and just basically be
> able do it all by myself.
>
> So, what am I missing? What is the link between .rb and .html?

Vintage may be of interest to you, although the documentation seems to
be sparse.

http://rubyforge.org/project...

Ralph Wood

10/16/2008 9:28:00 PM

0

Thanks for all the replies.

I've looked into your suggestions with more depth, and the possibility
I'm liking the most is the Phusion's Passenger mod.

But first I think I'm gonna try liquid's mini-tutorial on how to use
just merb-core to get a one-page app working. It looks like the more
hands-on approach, and it's what I'm looking for at the moment.

I had read about Sinatra earlier, but it looks like the project is
offline. Vintage looks interesting, but it appears to be somewhat
abandoned.

Just something else that isn't quite clear to me: my app should be
written in an erb file, right? Or HAML or the like.

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

Daniel N

10/16/2008 9:40:00 PM

0

[Note: parts of this message were removed to make it a legal post.]

On Fri, Oct 17, 2008 at 8:27 AM, Ralph Wood <esmero@gmail.com> wrote:

> Thanks for all the replies.
>
> I've looked into your suggestions with more depth, and the possibility
> I'm liking the most is the Phusion's Passenger mod.
>
> But first I think I'm gonna try liquid's mini-tutorial on how to use
> just merb-core to get a one-page app working. It looks like the more
> hands-on approach, and it's what I'm looking for at the moment.
>
> I had read about Sinatra earlier, but it looks like the project is
> offline. Vintage looks interesting, but it appears to be somewhat
> abandoned.
>
> Just something else that isn't quite clear to me: my app should be
> written in an erb file, right? Or HAML or the like.
>
> --
>

Hi Ralph,

You can use erb or haml for your views. It depends on what you're
comfortable with. My personal preference is haml but each to his own.

Cheers
Daniel

Michael Guterl

10/16/2008 10:02:00 PM

0

On Thu, Oct 16, 2008 at 5:27 PM, Ralph Wood <esmero@gmail.com> wrote:
> Thanks for all the replies.
>
> I've looked into your suggestions with more depth, and the possibility
> I'm liking the most is the Phusion's Passenger mod.
>
> But first I think I'm gonna try liquid's mini-tutorial on how to use
> just merb-core to get a one-page app working. It looks like the more
> hands-on approach, and it's what I'm looking for at the moment.
>
I think merb is a great choice.

> I had read about Sinatra earlier, but it looks like the project is
> offline. Vintage looks interesting, but it appears to be somewhat
> abandoned.
>
I want to point out that just because there hasn't been a Vintage
release in awhile does not mean it has been abandoned. It's purpose
is relatively simple and probably does not require many updates.

Michael Guterl