Skip to content

Instantly share code, notes, and snippets.

@tofumatt
Created October 18, 2011 17:08
Show Gist options
  • Save tofumatt/1295969 to your computer and use it in GitHub Desktop.
Save tofumatt/1295969 to your computer and use it in GitHub Desktop.
py-vs-ruby
# Python:
from django.shortcuts import render
from django.http import HttpResponse
def about(request):
return render(request, 'landing/about.html')
def home(request):
return render(request, 'landing/home.html')
def confirm_register(request):
return render(request, 'landing/confirm_register.html')
# Ruby:
['about', 'home', 'confirm_register'].each do |view|
return render(request, "landing/#{view}.html")
end
@tofumatt
Copy link
Author

@RFreeburn yeah, I've done stuff like that in Sinatra too (basically what I did in my Ruby version), but this lives in a larger Django app.

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