Skip to content

Commit

Permalink
made rails actually *use* static dispatch
Browse files Browse the repository at this point in the history
  • Loading branch information
jnicklas committed Jun 13, 2010
1 parent b8f4230 commit 1a5f016
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/capybara/rails.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Capybara.app = Rack::Builder.new do
map "/" do
if Rails.version.to_f >= 3.0
ActionDispatch::Static

This comment has been minimized.

Copy link
@gmoeck

gmoeck Jun 22, 2010

Not sure why, but this change breaks my Rails 3 system only when including Jose Valim's inherited_resources. See http://github.com/josevalim/inherited_resources/issues/closed#issue/58

This comment has been minimized.

Copy link
@gmoeck

gmoeck Jun 24, 2010

I'm actually now getting the same error in another application which is not using inherited_resources. Not sure what this is breaking, but seems to not be restricted to a single plugin.

This comment has been minimized.

Copy link
@jnicklas

jnicklas Jul 3, 2010

Author Collaborator

Apparently ActionDispatch::Static requires the path from which to serve assets as a second argument.

Then I figured out that Rails seems to actually serve assets without this line at all, so I removed it ;)

This comment has been minimized.

Copy link
@drogus

drogus Jul 4, 2010

Contributor

Rails3 uses ActionDispatch::Static by default at the beginning of middleware stack: http://github.com/rails/rails/blob/master/railties/lib/rails/application.rb#L183

use ActionDispatch::Static
run Rails.application
else # Rails 2
use Rails::Rack::Static
Expand Down

0 comments on commit 1a5f016

Please sign in to comment.