Search code examples
ruby-on-railsrubybootstrap-4blogs

Bootstrap in Ruby on Rails


I am currently working on this project: https://www.youtube.com/watch?v=pPy0GQJLZUM

When I try to enable bootstrap, around the 31 minute mark, I insert the latest version from the bootstrap cdn site. My code looks like this:

<!DOCTYPE html>
<html>
<head>
<title>Simpleblog</title>
<%= csrf_meta_tags %>
<%= csp_meta_tag %>
<%= stylesheet_link_tag https://stackpath.bootstrapcdn.com/twitter- 
bootstrap/2.1.0/css/bootstrap-combined.min.css %>
<%= stylesheet_link_tag    'application', media: 'all', 'data- 
turbolinks-track': 'reload' %>
<%= javascript_include_tag 'application', 'data-turbolinks-track': 
'reload' %>
</head>

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

However, when I go to localhost:3000, I receive a nasty error message that is displayed here: click here to see error screen

What is going on here? Any help to fix this issue would be greatly appreciated.


Solution

  • you just need to put that stylesheet link into quotes

    <!DOCTYPE html>
    <html>
    <head>
    <title>Simpleblog</title>
    <%= csrf_meta_tags %>
    <%= csp_meta_tag %>
    <%= stylesheet_link_tag 'https://stackpath.bootstrapcdn.com/twitter-bootstrap/2.1.0/css/bootstrap-combined.min.css' %>
    <%= stylesheet_link_tag    'application', media: 'all', 'data- 
    turbolinks-track': 'reload' %>
    <%= javascript_include_tag 'application', 'data-turbolinks-track': 
    'reload' %>
    </head>
    
     <body>
    <%= yield %>
     </body>
    </html>