# Extends ActionController::Routing::RouteSet to automatically add the rcss routes
class ActionController::Routing::RouteSet
alias_method :__draw, :draw
# Overrides the default RouteSet#draw to automatically
# include the routes needed by the StylesheetsController
def draw
old_routes = @routes
@routes = []
begin
create_rcss_routes
yield self
rescue
@routes = old_routes
raise
end
write_generation
write_recognition
end
# Creates the required routes for the StylesheetsController...
def create_rcss_routes
named_route 'rcss', "/stylesheets/:rcss.rcss", :controller=>'stylesheets', :action=>'rcss'
end
end