aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--actionpack/lib/action_controller/caching.rb2
-rw-r--r--actionpack/lib/action_controller/routing.rb3
-rw-r--r--railties/README10
-rwxr-xr-xrailties/configs/apache.conf2
4 files changed, 12 insertions, 5 deletions
diff --git a/actionpack/lib/action_controller/caching.rb b/actionpack/lib/action_controller/caching.rb
index 173457ace0..c1b08dc927 100644
--- a/actionpack/lib/action_controller/caching.rb
+++ b/actionpack/lib/action_controller/caching.rb
@@ -90,7 +90,7 @@ module ActionController #:nodoc:
private
def page_cache_path(path)
- page_cache_directory + path + ".html"
+ page_cache_directory + (path.empty? ? "/index" : path) + ".html"
end
end
diff --git a/actionpack/lib/action_controller/routing.rb b/actionpack/lib/action_controller/routing.rb
index 18645ae4e0..a806b995c0 100644
--- a/actionpack/lib/action_controller/routing.rb
+++ b/actionpack/lib/action_controller/routing.rb
@@ -211,11 +211,14 @@ module ActionController
# Note that we *do* return immediately if
def generate(options, request)
raise RoutingError, "There are no routes defined!" if @routes.empty?
+
options = options.symbolize_keys
defaults = request.path_parameters.symbolize_keys
expand_controller_path!(options, defaults)
defaults.delete_if {|k, v| options.key?(k) && options[k].nil?} # Remove defaults that have been manually cleared using :name => nil
+ options = defaults if options.empty? # Get back the current url if no options was passed
+
failures = []
selected = nil
self.each do |route|
diff --git a/railties/README b/railties/README
index cedb61ce21..49f82b54c1 100644
--- a/railties/README
+++ b/railties/README
@@ -71,11 +71,10 @@ server.port = 8080
server.bind = "127.0.0.1"
# server.event-handler = "freebsd-kqueue" # needed on OS X
-server.modules = ( "mod_rewrite", "mod_access", "mod_fastcgi" )
+server.modules = ( "mod_rewrite", "mod_fastcgi" )
-server.indexfiles = ( "index.html" )
-url.rewrite = ( "^([^.]+)$" => "$1.html" )
-server.error-handler-404 = "/dispatch.fcgi" # change to dispatch.cgi to run CGI
+url.rewrite = ( "^/$" => "index.html", "^([^.]+)$" => "$1.html" )
+server.error-handler-404 = "/dispatch.fcgi"
server.document-root = "/path/application/public"
server.errorlog = "/path/application/log/server.log"
@@ -169,6 +168,9 @@ app/helpers
config
Configuration files for Apache, database, and other dependencies.
+components
+ Self-contained mini-applications that can bundle controllers, models, and views together.
+
lib
Application specific libraries. Basically, any kind of custom code that doesn't
belong controllers, models, or helpers. This directory is in the load path.
diff --git a/railties/configs/apache.conf b/railties/configs/apache.conf
index 28c4c57aad..499477c57b 100755
--- a/railties/configs/apache.conf
+++ b/railties/configs/apache.conf
@@ -5,6 +5,8 @@ Options +FollowSymLinks +ExecCGI
# Redirect all requests not available on the filesystem to Rails
RewriteEngine On
+RewriteRule ^$ index.html [QSA]
+RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /dispatch.cgi?$1 [QSA,L]