Skip to content

Instantly share code, notes, and snippets.

namespace :test do
desc 'Measures test coverage'
task :coverage do
rm_f "coverage"
rm_f "coverage.data"
rcov = "rcov -Itest --rails --aggregate coverage.data -T -x \" rubygems/*,/Library/Ruby/Site/*,gems/*,rcov*\""
system("#{rcov} --no-html test/unit/*_test.rb test/unit/helpers/*_test.rb")
system("#{rcov} --no-html test/functional/*_test.rb")
system("#{rcov} --html test/integration/*_test.rb")
before_filter :find_dispensary, :only => [:show, :edit, :update, :destroy]
def show
@map = GMap.new("map_div")
@map.control_init(:large_map => true,:map_type => true)
@map.icon_global_init(GIcon.new(:image => '/images/weedleaf.png',
:icon_size => GSize.new(48, 48),
:icon_anchor => GPoint.new(24, 24),
:info_window_anchor => GPoint.new(22, 0),
:info_shadow_anchor => GPoint.new(18, 15)), "icon_source")
Rendering dispensaries/show
ActionView::TemplateError (cannibook.com) on line #3 of app/views/dispensaries/show.html.erb:
1: <h2><%=h @dispensary.name %></h2>
2:
3: <%= GMap.header %>
4: <%= javascript_include_tag("markerGroup") %>
5: <%= @map.to_html%>
6: <%= @map.div(:width => 500, :height => 450)%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- meta -->
<meta http-equiv="Content-type" content="text/html;charset=utf-8" />
<meta name="description" content="" />
<meta name="KEYWORDS" content="" />
<meta name="Copyright" content="Cannibook" />
# Be sure to restart your server when you modify this file
# Specifies gem version of Rails to use when vendor/rails is not present
RAILS_GEM_VERSION = '2.3.5' unless defined? RAILS_GEM_VERSION
# Bootstrap the Rails environment, frameworks, and default configuration
require File.join(File.dirname(__FILE__), 'boot')
Rails::Initializer.run do |config|
# Settings in config/environments/* take precedence over those specified here.