Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

screenshot urls

  • Loading branch information...
commit f427820ce42f41be02ac24e800c7d2b6be3d1c0a 1 parent f2ae97b
@stefl authored
View
1  Procfile.dev
@@ -1,2 +1,3 @@
+compass: bundle exec compass watch
web: bundle exec unicorn -p 4141 -c ./unicorn.rb
worker: bundle exec rake resque:work QUEUE=web
View
14 app/controllers/hacks.rb
@@ -9,12 +9,6 @@
haml :"hacks/index", :layout => !request.xhr?
end
- get :show, :map => "/hacks/:slug", :cache => true do
- expires_in 5
- @hack = Hack.where(:slug => params[:slug]).first
- haml :"hacks/show", :layout => !request.xhr?
- end
-
get :sitemap, :map => "/hacks/sitemap", :provides => [:xml], :cache => true do
expires_in 5
@hacks = Hack.all.order_by([[:published_at, :desc]])
@@ -26,4 +20,12 @@
map.render.gsub("http://sketchingwithcode.com/{:url=>"", "").gsub(""}","")
end
+ get :show, :map => "/hacks/:slug", :cache => true do
+ expires_in 5
+ @hack = Hack.where(:slug => params[:slug]).first
+ haml :"hacks/show", :layout => !request.xhr?
+ end
+
+
+
end
View
2  app/views/hacks/index.haml
@@ -17,7 +17,7 @@
- row.each do |hack|
%article.hack{:class=> row.last == hack ? "last" : ""}
.screengrab{:style=>"background-color:hsl(#{hack.hue},50%,75%); border-top: 8px solid hsl(#{hack.hue},50%,75%);"}
- - if hack.url && grab = @screengrabs.select {|s| s.slug == hack.url.sub("http://","").gsub(".", "-")}.first
+ - if hack.url && grab = @screengrabs.select {|s| s.slug == hack.url.sub("http://","").gsub(".", "-").gsub("/","-")}.first
%img{:src=>"/screengrabs/l/#{grab.slug}.jpg"}
%h1
- if hack.url
Please sign in to comment.
Something went wrong with that request. Please try again.