chrome-devtools-autosave icon indicating copy to clipboard operation
chrome-devtools-autosave copied to clipboard

Make it work with the Rails’ Asset Pipeline

Open NV opened this issue 13 years ago • 3 comments

Asset Pipeline

NV avatar Feb 16 '12 08:02 NV

Hey there !

I just tried to use autosave on a rails app and it saves the stylesheet in app/assets/application.css where the actual file is app/assets/stylesheets/application.css

What can I do to make this work ?

Thanks !

trenkwill avatar Mar 02 '12 07:03 trenkwill

Still looking for help.

NV avatar Mar 16 '12 04:03 NV

@trenkwill

Create a routes.js file:

exports.routes = [
    {
        from: new RegExp('http://my-rails-app.local/assets/(.+?\.css)'),
        to: '/Users/nv/my-rails-app/app/assets/stylesheets/$1'
    },
    {
        from: new RegExp('http://my-rails-app.local/assets/(.+?\.js)'),
        to: '/Users/nv/my-rails-app/app/assets/javascripts/$1'
    }
]

and run autosave --config routes.js.

Keep in mind, it won’t change files in the other assets directories such as lib/assets and vender/assets. This is why I’m asking for help with Rails plugin.

NV avatar Mar 16 '12 12:03 NV