Skip to content

Instantly share code, notes, and snippets.

@rubyonrailstutor
Last active December 16, 2015 20:19
Show Gist options
  • Save rubyonrailstutor/5491678 to your computer and use it in GitHub Desktop.
Save rubyonrailstutor/5491678 to your computer and use it in GitHub Desktop.
some rails code trying to make foundation work
//layouts/application.html.erb
<!DOCTYPE html>
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
<!--[if lt IE 7 ]> <html class="ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]> <html class="ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]> <html class="ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--> <html lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8" />
<!-- Uncomment to make IE8 render like IE7 -->
<!-- <meta http-equiv="X-UA-Compatible" content="IE=7" /> -->
<!-- Set the viewport width to device width for mobile -->
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title><%= content_for?(:title) ? yield(:title) : "Untitled" %></title>
<%= stylesheet_link_tag "application" %>
<%= javascript_include_tag "vendor/custom.modernizr" %>
<%= csrf_meta_tags %>
</head>
<body>
<%= render "layouts/nav_bar" %>
<div class="row">
<div id="main" class="large-10 large-centered columns panel margined">
<%= yield %>
</div>
</div>
<%= javascript_include_tag "application" %>
</body>
</html>
//application.js
//= require jquery
//= require jquery_ujs
//= require hamlcoffee
//= require foundation
//= require underscore
//= require backbone
//= require crowdsound
//= require_tree ../templates
//= require_tree ./models
//= require_tree ./collections
//= require_tree ./views
//= require_tree ./routers
//= require_tree .
$(document).foundation();
//application.scss
/*
*= require_self
//= require foundation_and_overrides
*= require_tree .
*/
@import "foundation";
@import "general_foundicons";
@mhayes
Copy link

mhayes commented May 28, 2013

If you ran the included Foundation generator (rails g foundation:install) you'll want to change:

/*
 *= require_self
 //= require foundation_and_overrides
 *= require_tree .
 */
@import "foundation";
@import "general_foundicons";

To:

/*
 *= require_self
 *= require foundation_and_overrides
 *= require_tree .
 */
@import "general_foundicons";

Otherwise you'll want to use this since app/assets/stylesheets/foundation_and_overrides.scss won't exist:

/*
 *= require_self
 *= require_tree .
 */
@import "foundation";
@import "general_foundicons";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment