Instructions needed to integrate the wrapbootstrap theme into the new rails application

I just bought a theme from wrapbootstrap and launched a new Rails application to experiment with it. The topic did not contain any documentation, and I'm new to Rails, so I could use some help. None of the other examples here are very detailed, and there seem to be no blog posts about this on the Internet. Thanks.

This is a topic if it helps. Suppose I run Rails 3, run a β€œnew experiment with rails”, and have not set any stones at this point without even loading at that moment. I would like to have the final instructions for others, from the very beginning, here in stackoverflow.

+6
source share
1 answer

I suggest you do the following:

1. Copy theme resources 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. Creating entries in asset declarations

  • Create an entry in app/assets/stylesheets/application.css for each CSS file that you want to include in the application. All files listed there should be automatically included in all pages using the default layout app/views/layouts/application.html.erb .
  • The same goes for JavaScripts under app/assets/javascripts/applications.js .

3. Separate theme settings from theme source files

Feel free to customize the theme, but place your own files under app/assets/stylesheets , app/assets/javascripts and app/assets/images . Thus, they will not mix with the theme that you acquired, and you can easily remove your changes without fear of distorting your topic.

4. Change image paths

Now you have to manually edit all your stylesheets and JavaScript files looking for links to images. Change all paths to /assets . For instance:

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

becomes:

 background-image: url('/assets/bck.png') 
+14
source

Source: https://habr.com/ru/post/945340/


All Articles