0

I'm trying to get the responsive navbar which disappears into a pulldown button on small screens.

My attempt rolls up into a button on my browsers as expected (when the browser window is narrowed), but the button does not pull down. However, if view the resulting page source and cut and paste the body into bootply, it works fine there. I'm guessing it's a problem with my bootstrap-sass or how I've set up my .scss files.

I tried rolling everything up in a single .scss file as discussed in Bootstrap Rails 4 sass layout not working but saw no change.

This is Rails 4.0.2, with gems sass-rails 4.0.3 and bootstrap-sass 3.1.1.1.

Bootply using the same body served from rails works: http://www.bootply.com/785c0msG86

Git repo demonstrating the issue: https://github.com/vt102/navbartest

Community
  • 1
  • 1
vt102
  • 103
  • 6
  • I can take the same page and make it static HTML (https://gist.github.com/vt102/8e15f2c17cdba3b165c3), with jquery and bootstrap from CDNs, and it works just fine. It's something in how it's being rendered. – vt102 May 26 '14 at 04:30

2 Answers2

1

You're not including Bootstrap's JS files into your application. The dropdown menus require Javascript to work properly; so inside this file:

https://github.com/vt102/navbartest/blob/master/app/assets/javascripts/application.js

You need to add a //= require bootstrap.

sevenseacat
  • 24,699
  • 6
  • 63
  • 88
0

I try that repository (clone to my computer and run) and I am able to see bootstrap (http://prntscr.com/3mk66r), did you try open your website in another broswer or delete broswer / rails (rake cache:clear) cache? I suppose you're starting server in development mode, in production there can be issue when you don't precompile your assets.

Jan Strnádek
  • 808
  • 5
  • 16
  • That's what I see. If you narrow your browser window, the "Sign up" and Login links should collapse into a pull down button. What I'm seeing is that when served from my rails server, I get the button, but there's no activity to it. I don't get the links dropped down when I click on it. – vt102 May 25 '14 at 22:09