[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Code behind HTML

Vince Panuccio

10/17/2006 1:16:00 PM

Hi,

After having some issues with eRuby and embedded ruby in HTML, Im trying
to find out if its possible to develop a web page in the same way that
ASP.NET works.

Basically you straight HTML with no embedded script and when all the
data is posted back to the server, you can use c# (or any language) to
handle and process the data returned.

I think CGI is different to what im after. Im looking at doing all my
processing in ruby and keeping my html 'clean'

Can someone point me in the right direction?

Thank you,
Vince

P.S
Im not interested in Rails.

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

6 Answers

Bil Kleb

10/17/2006 5:51:00 PM

0

Vince /. wrote:
> Hi,

Hi.

> Can someone point me in the right direction?

Probably not the right direction, but worth a stroll:

http://code.whytheluckystiff.n...

Later,
--
Bil Kleb
http://fun3d.lar...

Wilson Bilkovich

10/17/2006 6:01:00 PM

0

On 10/17/06, Vince /. <totalharmonicdistortion@hotmail.com> wrote:
> Hi,
>
> After having some issues with eRuby and embedded ruby in HTML, Im trying
> to find out if its possible to develop a web page in the same way that
> ASP.NET works.
>
> Basically you straight HTML with no embedded script and when all the
> data is posted back to the server, you can use c# (or any language) to
> handle and process the data returned.
>
> I think CGI is different to what im after. Im looking at doing all my
> processing in ruby and keeping my html 'clean'
>
> Can someone point me in the right direction?
>

What you've described isn't actually how ASP.NET works, but I can
understand what you're looking for.
I would say that 'Merb' is probably as close as it gets for Ruby
webapps right now:
http://brainspl.at/articles/2006/10/09/introducin...

Alternatively (or in addition to Merb), you could go with a templating
solution such as Liquid, instead of ERb. That way there's no direct
'Ruby' code mixed into your HTML. Some people like it that way.

Verno Miller

10/18/2006 6:19:00 PM

0

>Wilson Bilkovich wrote:
>
> ... you could go with a templating solution such as Liquid, instead of ERb. That way
> there's no direct 'Ruby' code mixed into your HTML.


Or with a templating solution such as:

http://amrita2.rub...

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

khaines

10/18/2006 7:59:00 PM

0

Jeff Barczewski

10/18/2006 8:33:00 PM

0

On 10/18/06, khaines@enigo.com <khaines@enigo.com> wrote:
> A snippet of a Nitro template;
>
> <?r @todolists.each do |todolist| ?>
> <div class="todolist">
> <div class="todolist_title">#{todolist.title}</div>
> <?r todolist.items.each do |item| ?>
> <div class="todolist_item">
> <div class="todolist_item_title">#{item.title}</div>
> <div class="todolist_item_text">#{item.text}</div>
> </div>
> <?r end ?>
> </div>
> <?r end ?>
>

Similarly, MasterView another template library which keeps the code
out of the html, the code would look like this.

<ul block="@todolists.each do |todolist|">
<li content="todolist.title">this will be replaced with actual title</li>
</ul>

MasterView has been primarily designed to work with Rails having
directives that utilize rails helpers, however it can also be used
with standard Ruby ERB if you forgo the Rails based directives.

The project is in Rubyforge and other documentation/videos are available at
http://maste...

If you have any questions just shoot me an email.

Jeff

Jeff Barczewski

10/18/2006 8:38:00 PM

0

oops. Forgot the namespace for the attributes should be prefixed with
mv: I have corrected it inline below.

On 10/18/06, Jeff Barczewski <jeff.barczewski@gmail.com> wrote:
> On 10/18/06, khaines@enigo.com <khaines@enigo.com> wrote:
> > A snippet of a Nitro template;
> >
> > <?r @todolists.each do |todolist| ?>
> > <div class="todolist">
> > <div class="todolist_title">#{todolist.title}</div>
> > <?r todolist.items.each do |item| ?>
> > <div class="todolist_item">
> > <div class="todolist_item_title">#{item.title}</div>
> > <div class="todolist_item_text">#{item.text}</div>
> > </div>
> > <?r end ?>
> > </div>
> > <?r end ?>
> >
>
> Similarly, MasterView another template library which keeps the code
> out of the html, the code would look like this.
>

<ul mv:block="@todolists.each do |todolist|">
<li mv:content="todolist.title">this will be replaced with actual title</li>
</ul>


>
> MasterView has been primarily designed to work with Rails having
> directives that utilize rails helpers, however it can also be used
> with standard Ruby ERB if you forgo the Rails based directives.
>
> The project is in Rubyforge and other documentation/videos are available at
> http://maste...
>
> If you have any questions just shoot me an email.
>
> Jeff
>
>