Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Need instructions integrating a wrapbootstrap theme into a new rails app

I just purchased a theme at wrapbootstrap and fired up a new Rails app to experiment with it. The theme came with no documentation and I am new to Rails, so I could use some help. None of the other examples here are very detailed and there do not seem to be blog posts about this online. Thanks.

This is the theme, if that helps- Presume that I am running Rails 3, have ran 'rails new experiment' and have installed no gems at this point, not even bootstrap at this point. Would love to have definitive instructions for others, from the beginning, here on stackoverflow.

like image 316
piratebroadcast Avatar asked May 19 '13 00:05

piratebroadcast


1 Answers

I suggest you do the following:

1. Copy theme assets to /vendor

  • Copy all CSS files to vendor/assets/stylesheets
  • Copy all JavaScript files to vendor/assets/javascripts
  • Copy all images to vendor/assets/images

2. Create entries in asset manifests

  • Create an entry in app/assets/stylesheets/application.css for each CSS file you wish to include in your application. All the files listed in there should be automatically included into all pages that use the default layout app/views/layouts/application.html.erb.
  • Same thing for JavaScripts under app/assets/javascripts/applications.js.

3. Separate theme customizations from original theme files

Feel free to customize your theme, but put your own files under app/assets/stylesheets, app/assets/javascripts and app/assets/images. That way they won't get mixed up with the theme you purchased and you can easily delete your changes without fear of mangling your theme.

4. Change image paths

Now you're going to have to manually edit all your stylesheets and JavaScript files looking for the image references. Change all paths to /assets. Like so:

background-image: url(http://www.example.com/images/bck.png)

Becomes:

background-image: url('/assets/bck.png')
like image 155
Marcelo De Polli Avatar answered Oct 16 '22 16:10

Marcelo De Polli