class Utopia::Redirection::DirectoryIndex
Redirect urls that end with a `/`, e.g. directories.
Public Class Methods
new(app, index: 'index')
click to toggle source
Calls superclass method
Utopia::Redirection::ClientRedirect::new
# File lib/utopia/redirection.rb, line 134 def initialize(app, index: 'index') @app = app @index = index super(app) end
Public Instance Methods
[](path)
click to toggle source
# File lib/utopia/redirection.rb, line 141 def [] path if path.end_with?('/') return redirect(path + @index) end end