ruby on rails - routes.rb - match file extension when multiple periods exist in filename

前端 未结 3 1933
后悔当初
后悔当初 2021-01-14 20:37

I have created a route plus controller for doing dynamic css in ruby on rails as per the instructions here:

http://www.misuse.org/science/2006/09/26/dynamic-css-in-r

3条回答
  •  粉色の甜心
    2021-01-14 21:01

    I used this for a general case when you don't know the extension:

    get '/uploads/:basename.:extenstion', to: 'controller#action', basename: /.*(?=\.[\w\d]+$)/
    

提交回复
热议问题