[Nitro] public root

D

Denis Nikiforov

(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.
 

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
474,297
Messages
2,571,536
Members
48,282
Latest member
Xyprime

Latest Threads

Top