It collapses like this.
Looking back on the work
Install Bootstrap gem on rails
Implemented navbar on the top page (also 4.3.1)
<nav> Navbar <button type = "button" data-toggle = "collapse" data-target = "# navbarSupportedContent" aria-controls = "navbarSupportedContent" aria-expanded = "false" aria-label = "Toggle navigation"> <span></span> </button> <ul> <li> Home<span>(current)</span> </li> <li> Link </li> <li> Disabled </li> </ul> <form> <input type = "text" placeholder = "Search" aria-label = "Search"> <button type = "submit">Search</button> </form> </nav>
Existing css file changed to scss
/ * * This is a manifest file that'll be compiled into application.css, which will include all the files * listed below. * * Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's * vendor/assets/stylesheets directory can be referenced here using a relative path. * * You're free to add application-wide styles to this file and they'll appear at the bottom of the * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS * files in this directory. Styles in this file should be added after the last require_ * statement. * It is generally better to create a new file per style scope. * * / @import "bootstrap-sprockets"; @import "bootstrap";
I expect that Bootstrap is probably installed.
I thought that the display was broken because of asset, but I didn't understand the cause.
I would appreciate it if you could teach me.
Answer # 1
The method of editing an existing css file didn't work.
I created a new scss file and imported it and it worked.
@import "bootstrap-sprockets"; @import "bootstrap";
Only two files to mess with!
- ruby on rails - i want to display activehash in the view file with the corresponding character instead of id
- ruby - dynamically display rails select box choices
- ruby on rails - i want to display a list of liked data
- ruby on rails - [rails] about the display position after redirect by pressing like
- ruby on rails - i want to display all the images in the [rails] directory in the browser!
- ruby on rails - display all tweets of the user you are following on the top page
- ruby on rails - i want to display the details page
- ruby on rails - i want to display the posted images in a random order (get information from the record)
- ruby - i want to display specific columns in rails in descending order of numbers
- ruby on rails - i want to display the numbers entered in the line graph of chart kick
- ruby on rails - [rails 6] i'm using bootstrap 4, but the layout collapses only after logging out
- [ruby on rails] i want to display a parent model that matches the information of the associated child model
- ruby on rails 6 - [rails] i want to update the display of chat room participants etc in real time
- ruby - rails comment function display
- ruby on rails - i want to display search results
- ruby on rails - i want to display the posted image in the background using image_tag or url_for
- ruby on rails - [rails6] i want to display the validation error generated by update by index
- ruby on rails - i want to display "sold out" when the product is sold
- ruby on rails - [rails beginner] i want to display the posted content on my page
- ruby - [rails] parameter transmission is not executed properly after installing bootstrap
- ruby - bootstrap image is not displayed
- ruby - [rails] about errors when installing bootstrap
- ruby - i don't feel that the sql issued by rails has a different format from the sql that i usually write
- html - about boot strap free introduction
- ruby - i don't understand the meaning of "redis:" described in yml file etc when dealing with redis in rails
- ruby - the top screen is displayed at http: // localhost: 3000/users/sign_in
- ruby - the image is displayed as strange characters in rails
- ruby - the error in rails g migration cannot be resolved