Has anyone gotten Zurb-Foundation JavaScript working?

8 views
Skip to first unread message

David Williams

unread,
Dec 27, 2014, 8:35:10 PM12/27/14
to rubyonra...@googlegroups.com
The method that Zurb posted in the applications section of their website
isn't firing off the JavaScript commands for many of the components that
they have available for developers.

Here's the setup

application.html.erb
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</head>

application.scss.css
/*= require foundation */
@import "foundation_and_overrides";


application.js
//= require foundation
$(document).foundation();


I used the modernizr gem and installed it directly to support the
JavaScript.

Even so, with everything put in place. My drop-down buttons aren't
working..Only for the top-bar which has no-turbo-link added to disable
them.

If you found out a way to solve this issue. Please, let me know. I'm
currently at a stand still and many of the Zurb features are completely
useless without the JS enabled.

--
Posted via http://www.ruby-forum.com/.

Hassan Schroeder

unread,
Dec 27, 2014, 9:28:42 PM12/27/14
to rubyonrails-talk
On Sat, Dec 27, 2014 at 5:34 PM, David Williams <li...@ruby-forum.com> wrote:
> The method that Zurb posted in the applications section of their website
> isn't firing off the JavaScript commands for many of the components that
> they have available for developers.

I'd recommend you create a simple app/test case that illustrates the
problem and post a link to it.

--
Hassan Schroeder ------------------------ hassan.s...@gmail.com
http://about.me/hassanschroeder
twitter: @hassan

Walter Lee Davis

unread,
Dec 27, 2014, 10:14:43 PM12/27/14
to rubyonra...@googlegroups.com
Anything that is using the page load event to trigger setup will generally fail in the presence of turbolinks. You can either disable them entirely, or you can wrap your foundation() call in an observer on the page:change synthetic event. In jQuery, that's probably going to be something like this:

$(document).on('page:change', function(){
// your foundation methods here
});

Walter


David Williams

unread,
Dec 27, 2014, 10:47:44 PM12/27/14
to rubyonra...@googlegroups.com
Walter Davis wrote in post #1165528:
Should I just disable turbolinks? for javascript files? Also, I have
certain files outside of the vendor folder or does ruby automatically
pickup all files inside of the javascript directory including the ones
in folders?

David Williams

unread,
Dec 27, 2014, 11:07:47 PM12/27/14
to rubyonra...@googlegroups.com
Walter Davis wrote in post #1165528:
Having to use this method every time is kind of a headache. I may just
try to disable turbolinks for Javascript all together.

Vivek Sampara

unread,
Dec 28, 2014, 12:44:20 AM12/28/14
to rubyonra...@googlegroups.com
Hi, 

I've created a hobby project using zurb foundation framework. Its a bit old but i think it can help you. Pushed it to git 


Cheers

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/0be024f091eb1b9de9ab4efc4285248e%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

David Williams

unread,
Dec 28, 2014, 12:26:10 PM12/28/14
to rubyonra...@googlegroups.com
Vivek Sampara wrote in post #1165533:
> Hi,
>
> I've created a hobby project using zurb foundation framework. Its a bit
> old
> but i think it can help you. Pushed it to git
>
> https://github.com/ravensnowbird/unfollowjerks
>
> Cheers
>
> On Sun, Dec 28, 2014 at 9:37 AM, David Williams <li...@ruby-forum.com>

Thanks, I'll check it out.

David Williams

unread,
Dec 28, 2014, 5:08:16 PM12/28/14
to rubyonra...@googlegroups.com
Vivek Sampara wrote in post #1165533:
> Hi,
>
> I've created a hobby project using zurb foundation framework. Its a bit
> old
> but i think it can help you. Pushed it to git
>
> https://github.com/ravensnowbird/unfollowjerks
>
> Cheers
>
> On Sun, Dec 28, 2014 at 9:37 AM, David Williams <li...@ruby-forum.com>

My foundation-rails gem was locked to 5.4.0, maybe that was the problem.
I'll see tomorrow morning when I start the workday.
Reply all
Reply to author
Forward
0 new messages