Rails和主题林集成问题,出现路由错误

时间:2019-02-21 07:24:38

标签: ruby-on-rails ruby-on-rails-5 themes

我正在尝试将themeforest模板集成到Rails应用程序中。我收到路由错误

  

ActionController :: RoutingError(没有与[GET]“ /assets/fonts/fontawesome-webfont.woff”匹配的路由):

我实际上遵循了Themeforest to Rails App

中给出的解决方案

结构为

  

-assets - fonts - images - javascripts - stylesheets

我的font-awesome.css文件具有

  

@font-face { font-family: 'FontAwesome'; src: url('fonts/fontawesome-webfont.eot?v=4.2.0'); src: url('fonts/fontawesome-webfont.eot?#iefix&v=4.2.0') format('embedded-opentype'), url('fonts/fontawesome-webfont.woff?v=4.2.0') format('woff'), url('fonts/fontawesome-webfont.ttf?v=4.2.0') format('truetype'), url('fonts/fontawesome-webfont.svg?v=4.2.0#fontawesomeregular') format('svg'); font-weight: normal; font-style: normal; }

我要去哪里错了?

1 个答案:

答案 0 :(得分:0)

我认为问题在于您如何使用路径,您可以将其更改为

@font-face {
    font-family: 'FontAwesome';
    src: asset-url('fontawesome-webfont.eot');
    src: asset-url('fontawesome-webfont.eot') format('embedded-opentype'),
           asset-url('fontawesome-webfont.woff') format('woff'),
           asset-url('fontawesome-webfont.ttf') format('truetype'),
           asset-url('fontawesome-webfont.svg#fontawesomeregular') format('svg');
    font-weight: normal;
    font-style: normal;
}