Forum: Rails-ES routes y mod_rewrite

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
6f4b54e5709668aac38d8c078254ac3f?d=identicon&s=25 Javier Martinez (Guest)
on 2007-03-19 15:36
(Received via mailing list)
Leyendo acerca de las rutas en rails, he ido a parar al wiki. En él, me
encuentro con este parrafo.

---------------------------------------------------------------------------------------------------------
'Routing' is a pure-Ruby
mod_rewrite<http://wiki.rubyonrails.org/rails/pages/mod_rewrit...
that can map URLs to
controller/action/params and back. It was added to Rails to make pretty
URLs more configurable and to divorce us from the mod_rewrite
requirement.
---------------------------------------------------------------------------------------------------------

Segun esto, las rutas entre otras cosas, se hicieron para deshacerse del
mod_rewrite. Sin embargo, cuando creas un proyecto rails, en el
directorio
"public" puedes encontrar el archivo .htaccess, que para poder
interpretar
ciertas lineas, necesita del modulo mod_rewrite. Estas por ejemplo

----------------------------------------------------------------------
RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
----------------------------------------------------------------------

¿Que es lo que me he perdido?
Ffd012d72e7f61639724878825ed25a3?d=identicon&s=25 Damian Janowski (djanowski)
on 2007-03-19 17:16
(Received via mailing list)
On 3/19/07, Javier Martinez <ecentinela@gmail.com> wrote:
> 
---------------------------------------------------------------------------------------------------------
> 'Routing' is a pure-Ruby mod_rewrite-alike that can map URLs to
> controller/action/params and back. It was added to Rails to make pretty
> URLs more configurable and to divorce us from the mod_rewrite
> requirement.
> 
---------------------------------------------------------------------------------------------------------
> ¿Que es lo que me he perdido?

Creo que quiere decir que no necesitás una RewriteRule por cada ruta
que definís...

Sólo están esas RewriteRule para que Rails funcione, pero el resto se
hace todo desde routes.rb.
6f4b54e5709668aac38d8c078254ac3f?d=identicon&s=25 Javier Martínez Fernández (Guest)
on 2007-03-19 20:23
(Received via mailing list)
aaaaam! pos lo entendí mal! Gracias!
This topic is locked and can not be replied to.