unable to view bootstrap navigation bar

I can't seem to get my Bootstrap application page in rails with postgresql and turbolinks disabled to work properly. I've tried everything but still can't figure out what's wrong.

<!DOCTYPE html>
<html>
 <head>
<title>Website</title>
<%= csrf_meta_tags %>

<%= stylesheet_link_tag    'application', media: 'all' %>
<%= javascript_include_tag 'application' %>
<link rel="stylesheet" 
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" 
integrity="sha384-
BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" 
crossorigin="anonymous">
</head>
<body>


<nav class="navbar navbar-toggleable-md navbar-light bg-faded">
<button class="navbar-toggler navbar-toggler-right" type="button" data-
toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-
expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<a class="navbar-brand" href="#">Navbar</a>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav">
  <li class="nav-item active">
    <a class="nav-link" href="#">Home <span class="sr-only">(current)</span>
</a>
  </li>
  <li class="nav-item">
    <a class="nav-link" href="#">Features</a>
  </li>
  <li class="nav-item">
    <a class="nav-link" href="#">Pricing</a>
  </li>
  <li class="nav-item">
    <a class="nav-link disabled" href="#">Disabled</a>
  </li>
  </ul>
 </div>
</nav>


<%= yield %>
</body>
</html>

Check out how the page looks here I'm getting some errors in the browser console, even though I'm using Bootstrap Gem and jquery Gem. Any idea why?

Answer №1

Make sure you have both the CSS and JS files imported for Bootstrap to work properly.

<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>

Consider using the bootstrap gem, like bootstrap-sass, for a smoother integration.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

index.html: using jquery for selecting colors

I attempted to integrate a jQuery plugin into my application, but it doesn't seem to be working. In the head section of my code, I have included: <link rel="stylesheet" media="screen" type="text/css" href="./style/colorpicker.css" /> <script ...

Troubleshooting Media Queries Problems in HTML and CSS

Check out the code snippet below: //Modifying text content (function() { var texts = $(".altered"); var textIndex = -1; function displayNextText() { ++textIndex; var t = texts.eq(textIndex) .fadeIn(2000) if (textIndex < te ...

Tips for Positioning Sidebar Elements Relative to Content IDs

My goal is to have sidebar elements align with specific id tags in the main content, rather than just stacking up one after another. I want the sidebar elements to align with certain id tags mentioned in the main post content. The image at shows the basic ...

To ascertain whether the mouse is still lingering over the menu

I have a condensed menu construction that unfortunately cannot be changed in HTML, only CSS and JS modifications are possible! $('span').on("hover", handleHover('span')); function handleHover(e) { $(e).on({ mouse ...

Removing margins in Bootstrap 5: A step-by-step guide

Currently facing an issue with removing margins in bootstrap. I am looking to set up two graphics that indicate the under construction status of the page - one for desktop and one for mobile devices. This is what I have tried so far: <!DOCTYPE html> ...

Tips on personalizing the checkbox by incorporating a custom background image

Looking to spruce up the standard checkbox? We're open to any method - whether it's a background image, CSS3, or some jQuery magic. Check out this example for inspiration! ...

Having trouble getting Bootstrap 5 to work with a position-relative row?

I am having trouble placing the * sign on the left side. Whenever I try to do so, it only works if I remove the row class. <!doctype html> <html lang="fa" dir="rtl"> <head> <meta charset="utf-8"> ...

Trimming the div tag from the bottom of the webpage

Currently utilizing bootstrap 4.0.0-beta.2 and encountering a CSS issue. In the specific layouthttps://i.sstatic.net/7WOGu.png Here is the HTML: <link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-beta/css/bootstrap.min.css" re ...

Tiny containers are positioned outside the boundaries of the larger container

click here to view image description Having trouble with my dashboard layout When adding small boxes, they exceed the page boundaries when moving to a new row The boxes in the first row display correctly, but issues arise with subsequent rows Seeking advi ...

Conflicts in SwiperJS Timeline Management

Having a Timeline on my Website using SwiperJS presents challenges with conflicting functions. The goal is to navigate swiper-slides by clicking on timespans in the timeline. The desired functionality for the timeline includes: Sliding to the correspondi ...

Switch up the linear gradient background periodically

Is there a way to change the background after a certain amount of time? It seems to work fine if the background color is just a solid color, but when it's a gradient as shown in the code below, the solution doesn't seem to work. Any suggestions f ...

Can Bootstrap be used to emphasize changed input text?

Is there a feature or customizable tool that can visually highlight input elements when they have been changed? This could involve applying a distinguishing visual cue, such as an orange border, to any input that no longer contains its default value. To ...

Determining the active status of a class using oTree and JavaScript

Upon running the following code: <div id="1-round" class="btn-group btn-group-toggle btn-lg" data-toggle="buttons" > {% for checkbox in form.players_choice %} <label class="btn btn-primary rounded mr-3 active btn-lg 1-round" style="ma ...

Just starting to learn jquery and I'm struggling with this code, can someone help?

I am trying to move the .icon element to the right and animate it based on its position().left value. Unfortunately, my code is not working as expected and I can't figure out why. It seems like such a simple task! <script> $("li.menu-item").ho ...

Utilize a fresh font style and replace the font family components in @mui/material with the new

Looking to bring in a fresh font family stored in a fonts directory and replace the existing mui base font family. import { responsiveFontSizes, createTheme } from '@mui/material'; import NEWFONTFAMILLY from '../fonts/something.otf' c ...

What steps should be taken to switch a class from one li element to another and remove it in the process?

As I develop the navigation bar for my website, I am faced with a challenge. I want to create a button-like behavior where clicking on an li element triggers a drop-down section underneath it without using the # attribute to prevent jumping to the top of t ...

Guide to animating an HTML element with CSS

Recently, I've been pondering the process of animating an HTML element solely through CSS. Unfortunately, my knowledge on the subject is quite lacking... I attempted to utilize the animate keyword in pursuit of this goal ...

The Slider within the Modal only becomes visible after I adjust the screen size

I am facing an issue with a slider inside a modal. The problem is that the slider does not show on the screen when the modal is opened. However, it appears when I manually resize the window. After some research, I found out that this issue is caused becau ...

Centering Text in CSS and HTML

Today I am pondering over how to align text horizontally on my website. The layout of us.mineplex.com's forums, shop, and title is perfectly aligned in a horizontal manner. I have tried to figure it out on my own but need some help. Thank you. CSS: ...

Ways to recognize when a button has been pressed

I developed my website using the CodeIgniter framework. Here is my personal website On the homepage, if I click on the "landscape" picture (top right) or the "landscape" button in the menu, it takes me to the "landscape" page. However, when I return to t ...