Rails-api无法在公共文件夹中找到我的css文件

时间:2014-10-11 00:21:44

标签: css ruby-on-rails angularjs ruby-on-rails-4 rails-api

我正在使用angularJS运行rails api。我的根设置为:root :to => "main#Home"

和MainController定义为:

class MainController < ApplicationController
  def Home
    render :file => "public/angular/app/index.html"
  end
end

在html文件中我链接到css和一些js文件,这些文件在公共目录中。我想避免使用rails app / assets文件夹,因为rails只会用作API,因此所有模板都将通过angular加载,我只需要一种方法来加载带有所有样式和js的索引页面。

我做错了什么?

编辑:

其中一个错误:

ActionController::RoutingError (No route matches [GET] "/bower_components/angular-route/angular-route.js"):

0 个答案:

没有答案