Luigi
Luigi

Reputation: 5603

Install twitter bootstrap theme into rails 4 app - Vendor/assets directory not found?

I am attempting to install a theme from wrapbootstrap.com into my rails 4.1 application.

I created a new app with rails 4 scaffolding. I then took the downloaded zip directory which includes 4 directories and an index.html file and placed them where I thought they should go:

css moved to vendor/assets/stylesheets, js moved to vendor/assets/javascripts, font moved to vendor/assets/fonts, and img moved to vendor/assets/images.

I then added this code to me app/assets/stylesheets file:

*= require_tree ../../../vendor/assets/stylesheets/.

and this code to my app/assets/javascripts file:

//= require_tree ../../../vendor/assets/javascripts/.

At this point, I assumed I had all the files I needed in place, so I copied index.html over into my app and pointed my browser to the appropriate view. Basically all I see is plain text - The css/javascript/image files are not working as intended.

When looking at my google Chrome developer tools, I see a bunch of errors similar to this one:

GET http://localhost:3000/vendor/assets/stylesheets/bootstrap.min.css 404 (Not Found)

What am I missing here to get this theme to work?

EDIT:

my html file looks like this where I am requiring the files:

<!-- Styles -->
        <!-- Bootstrap CSS -->
        <link href="../../../vendor/assets/stylesheets/bootstrap.min.css" rel="stylesheet">
        <!-- Font awesome CSS -->
        <link href="../../../vendor/assets/stylesheets/font-awesome.min.css" rel="stylesheet">
        <!-- Pretty Photo -->
        <link href="../../../vendor/assets/stylesheets/prettyPhoto.css" rel="stylesheet">
        <!-- Animate -->
        <link href="../../../vendor/assets/stylesheets/animate.min.css" rel="stylesheet">
        <!-- Custom CSS -->
        <link href="../../../vendor/assets/stylesheets/style.css" rel="stylesheet">

Upvotes: 1

Views: 526

Answers (1)

jbmyid
jbmyid

Reputation: 2015

Dont put vendor path in the href just add normal <%= stylesheet_link_tag 'application', media: 'all' %> and include other css in application.css file`

Upvotes: 1

Related Questions