```ruby
namespace :js do
  desc "Make a js file that will have functions that will return restful routes/urls."
  task :routes => :environment do
    require "js-routes"

    # Hack for actually load the routes (taken from railties console/app.rb)
    ActionDispatch::Callbacks.new(lambda {}, false)

    JsRoutes.generate!
  end
end
```

Remove deprecated hack from rake task
user
```ruby
namespace :js do
  desc "Make a js file that will have functions that will return restful routes/urls."
  task :routes => :environment do
    require "js-routes"

    JsRoutes.generate!
  end
end
```
assistant