[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

[Nitro] public root

Denis Nikiforov

5/11/2006 3:28:00 AM

(transmit-message (Hello *All*)
(Say '(

My apache' DocumentRoot looks like /my/home/folder/site/www/. Nitro is
placed in /my/home/folder/site/www/path/to/nitro/.

How must I configure Nitro?

I'd placed this dirty hack into my run.rb:

,----[ run.rb ]
| if ENV["REQUEST_URI"] =~ /^\/path\/to\/nitro\/public\//
| ENV["REQUEST_URI"]=ENV["REQUEST_URI"].sub('/path/to/nitro/public/', '/')
| BASE_URI = '/path/to/nitro/public'
| else
| BASE_URI = ''
| end
|
| class BaseURIMorpher < Morpher
| def before_start(buffer)
| if @attributes['href']
| if @attributes['href'] =~ /^\//
| @attributes['href'] = BASE_URI + @attributes['href']
| elsif @attributes['href'] =~ /^http:\/\//
| @attributes['href']
| else
| @attributes['href'] = BASE_URI + '/' + @attributes['href']
| end
| end
| if @attributes['action']
| if @attributes['action'] =~ /^\//
| @attributes['action'] = BASE_URI + @attributes['action']
| else
| @attributes['action'] = BASE_URI + '/' + @attributes['action']
| end
| end
| end
| end
|
| Morphing.add_morpher :href, BaseURIMorpher
| Morphing.add_morpher :action, BaseURIMorpher
`----

But it's too ugly and buggy ;( Actually, it doesn't work for forms
generated with form_for.

--
))) => t
1 Answer

Greg Chagnon

5/11/2006 4:48:00 PM

0

You might want to try the nitro mailinglist.

http://rubyforge.org/pipermail/nitr...

http://rubyforge.org/mailman/listinfo/nit...


"Denis Nikiforov" <denis@ural.org> wrote in message
news:87u07xs0jm.fsf@arietis.arietis...
> (transmit-message (Hello *All*)
> (Say '(
>
> My apache' DocumentRoot looks like /my/home/folder/site/www/. Nitro is
> placed in /my/home/folder/site/www/path/to/nitro/.
>
> How must I configure Nitro?
>
> I'd placed this dirty hack into my run.rb:
>
> ,----[ run.rb ]
> | if ENV["REQUEST_URI"] =~ /^\/path\/to\/nitro\/public\//
> | ENV["REQUEST_URI"]=ENV["REQUEST_URI"].sub('/path/to/nitro/public/',
> '/')
> | BASE_URI = '/path/to/nitro/public'
> | else
> | BASE_URI = ''
> | end
> |
> | class BaseURIMorpher < Morpher
> | def before_start(buffer)
> | if @attributes['href']
> | if @attributes['href'] =~ /^\//
> | @attributes['href'] = BASE_URI + @attributes['href']
> | elsif @attributes['href'] =~ /^http:\/\//
> | @attributes['href']
> | else
> | @attributes['href'] = BASE_URI + '/' + @attributes['href']
> | end
> | end
> | if @attributes['action']
> | if @attributes['action'] =~ /^\//
> | @attributes['action'] = BASE_URI + @attributes['action']
> | else
> | @attributes['action'] = BASE_URI + '/' + @attributes['action']
> | end
> | end
> | end
> | end
> |
> | Morphing.add_morpher :href, BaseURIMorpher
> | Morphing.add_morpher :action, BaseURIMorpher
> `----
>
> But it's too ugly and buggy ;( Actually, it doesn't work for forms
> generated with form_for.
>
> --
> ))) => t