Series: Duck Map

Duck Map Quick Start

Previous Article

Created: 02/19/2013 10:39:35 AM  Last Updated: 02/25/2014 04:25:44 PM

Tags:Duck Map, Sitemap, Ruby On Rails, Rails 3.x

Duck Map Quick Start

Including a sitemap into your Rails app is very easy with Duck Map. The following steps are taken directly from the included in the duck_map.gem

# open a shell and navigate to a work directory.
# create a Rails app
rails new --skip-bundle

# add the following to your Rails app
gem 'duck_map'

# depending on your Rails version, you may have to add the following lines as well.
gem 'execjs'
gem 'therubyracer'

# make sure you have all the gems, etc.
bundle install

# create a controller
rails g controller home

# create a route in config/routes.rb
root :to => 'home#index'

# start the server
rails s

# view the sitemap

# if you view the HTML source of: http://localhost:3000/sitemap.xml
# you should see something similar to the following:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="">

You can download the support file and run the actual app used in the video. Be sure to run: bundle install !!