rassom
rassom

Reputation: 2966

How to use Zurb Foundation 3 in a Rails project?

I am starting to learn Rails and have created a new 3.2.8 project where I want to include the Zurb Foundation framework and want to make it as easy as possible to update (patches and new "features") the framework going forward - which, I guess?, would be best done with a 'gem install xx' now and then 'gem update' further down the road.

Stumbled upon https://github.com/zurb/foundation-rails (which is for Foundation 2) where it is stated that "The current zurb-foundation gem is now hosted at: https://github.com/zurb/foundation" - but I can't seem to find a gem for Foundation 3 there.

Sorry if this is a novice question, but I guess we all have to start somewhere :-)

Can anyone help, please?

Upvotes: 2

Views: 5254

Answers (2)

lux
lux

Reputation: 37

You can find the Zurb Foundation install guide for Rails 3 here: http://foundation.zurb.com/docs/rails.html

Upvotes: 2

Chris
Chris

Reputation: 3915

http://foundation.zurb.com/docs/rails.html

Normally I wouldn't do this, but since this keeps disappearing in history of 404s, I'll paste some of it here. This is current as of Foundation 4 (3/1/2013):

Gemfile

group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'
  gem 'uglifier', '>= 1.0.3'
  # Add Foundation Here
  gem 'zurb-foundation', '~> 4.0.0'
end

then

$bundle install

Easy install:

rails g foundation:install

Manual install:

app/assets/stylesheets/application.scss

@import "foundation";

app/assets/javascripts/application.js

//= require foundation

my_layout.html.erb

<head>
    <!--Add to your head inside your page layout-->
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
</head>

Upvotes: 10

Related Questions