Menu icon Foundation
Installation with foundation-rails appears to work, but features not working

Hopefully this tag won't be marked as spam yet again...

I have used the foundation-rails gem to attempt to install foundation. It should be easy: add the gem, bundle, and run the generator.

And, that part was. It added lines to the appropriate files and added the foundation_and_overrides.scss file.

So to test it, I copied and pasted some code from the foundation website-- the source code, not just the sample code.

Some things work, like buttons and the grid.

But many more things do NOT work, i.e., callouts, top bar, accordian.

So my question first of all is, does the foundation-rails gem even work? Is it supported? Does Foundation work?

installation

Hopefully this tag won't be marked as spam yet again...

I have used the foundation-rails gem to attempt to install foundation. It should be easy: add the gem, bundle, and run the generator.

And, that part was. It added lines to the appropriate files and added the foundation_and_overrides.scss file.

So to test it, I copied and pasted some code from the foundation website-- the source code, not just the sample code.

Some things work, like buttons and the grid.

But many more things do NOT work, i.e., callouts, top bar, accordian.

So my question first of all is, does the foundation-rails gem even work? Is it supported? Does Foundation work?

Rafi Benkual about 2 years ago

Hi Tim
What version of Foundation are you trying to install with the rails gem? Right now, Foundation 5 has a rails gem. You can find the install info for here: http://foundation.zurb.com/sites/docs/v/5.5.3/applications.html

Sebastian Garavano 9 months ago

Hi Tim,

for me is the same. Now the gem is working with Foundation 6, but looks like the components with javascript does not work. My stack is Rails 5, React.js and Foundation 6 (both, React and Foundation installed by gem). I can't figure out what the problem is. If somebody has some similar problem please let me know.

Mike Pretti about 2 months ago

I'm having the same issue.

Using Rails 5.1.4

Using foundation-rails 6.4.1.2

 

Running rake assets:precompile works just fine, but when I try including a component that uses javascript (drop down menu, accordion etc) the style seems fine, but the actions like hover, or click don't seem to work.

There are no errors in the javascript console. 

 

Confused. Is there a quick test I can do to confirm foundation's javascript is being loaded properly ? 

If i run $(document).foundation(); in the console I get:

foundation.core.self-6ee2c48511cba0414489173bd3e993a8fc088ed879ddd4bdbbb1ee26123dc4da.js?body=1:344 Tried to initialize dropdown-menu on an element that already has a Foundation plugin.

 

Not sure where to look next. I followed https://www.rubyplus.com/articles/4271-Using-Zurb-Foundation-6-with-Rails-5-Apps to get the initial setup working.

 

Cameron de Bruyn about 2 months ago

So I've had the same problem. It seems to me that react-rails and foundation-rails both have javascript files which are the same. So then there is a double inclusion of some sort. I just haven't figured out which files yet. I think it could be modernizr.js.