Currently, I am creating an application using Ruby on rails.
The environment uses macOS and AWS.
Before setting up a project with rails, I downloaded the layout from an external site, edited it with VScode, and created some views.
When I tried to reflect this in rails, there are many files in the layout of the external site, and I am at a loss as to how to reflect them in rails.
I'm sorry for the beginner's question, but I would appreciate it if you could answer.
External site layout:
Structure of the original file that I want to reflect in rails this time
After changing according to the answer you received
→ The following error occurs (boostrap css file cannot be found)
application.css / * * = require vendors/bootstrap/css/bootstrap * = require css/mystyles * /
Answer # 1
I tried using the asset pipeline.
Asset Pipeline-Rails Guide
Place the files under assets of the downloaded file in vendor/assets/stream.
vendor/assets/stream --css / --img / --img-temp / --include / --js / --vendor /
Edit the following two files
//= require vendors/jquery.min // = require vendors/jquery.migrate.min //= require vendors/popper.min //= require vendors/bootstrap/js/bootstrap.min // = require js/global
/ * * = require vendors/bootstrap/css/bootstrap * = require css/styles * /
js global and css styles got an error if they were named as they are, so
Actually, I changed the notation of myglobal, mystyles, file name and require.
Also, on the way
Sprockets :: Rails :: Helper :: AssetNotPrecompiledI got an error, so I added the following.
(Rails5 may not give an error)
Rails.application.config.assets.precompile + =% w (application.js)
For the file read by application.js/scss, refer to the following "Starter Template"
- ruby on rails - i want to reflect the partial template only when i am logged in
- ruby on rails - i want to reflect the conditional expression when the value is null in the if statement of view
- ruby on rails - [rails 6] i'm using bootstrap 4, but the layout collapses only after logging out
- ruby - i want to reflect css
- ruby - when you edit the code only in the development environment when you require an external module, if you just reload the sc
- ruby - rails bootstrap 3 column layout
- ruby on rails - i want to get data from a specific column and reflect it in the view
- ruby - jayml does not reflect on models of 2 or more
- ruby - [rails] i want to add multiple records for each date and reflect them
- ruby - 'rbenv' is not recognized as an internal or external command, operable program or batch file
- ruby - [rails] i want to change the table to reflect using conditional branching
- ruby - passing variables using render partial
- ruby - deployment error on heroku
- ruby - output the total integer value held by each user
- ruby - i want to use the search method for active hash data
- ruby - destroy action does not respond
- ruby - how do you see the rails controller relative path? (carrierwave directory deleted)
- ruby - when deploying on capistrano, i get the error "access denied for user'ec2-user' @'localhost' (using password: no)&qu
- ruby - how nice! function routes do not pass well (relation) [rails]