This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# requires the geopy library from this site: | |
# https://code.google.com/p/geopy/ | |
# only runs under python 2.6 because of geopy | |
import sys | |
import re | |
from geopy import geocoders | |
for file in sys.argv[1:]: | |
print("working on " + file + "...") | |
FILE = open(file) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Gotospace::Application.routes.draw do | |
devise_for :users do | |
resources :lists | |
end | |
# The priority is based upon order of creation: | |
# first created -> highest priority. | |
# Sample of regular route: | |
# match 'products/:id' => 'catalog#view' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>Listing lists</h1> | |
<table> | |
<tr> | |
<th></th> | |
<th></th> | |
<th></th> | |
<th></th> | |
</tr> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ListsController < ApplicationController | |
before_filter :authenticate_user! | |
# GET /lists | |
# GET /lists.json | |
def index | |
@lists = current_user.lists | |
respond_to do |format| | |
format.html # index.html.erb | |
format.json { render json: @lists } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Gotospace::Application.routes.draw do | |
devise_for :users do | |
resources :lists do | |
resources :todos | |
end | |
end | |
# The priority is based upon order of creation: | |
# first created -> highest priority. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Gotospace::Application.routes.draw do | |
devise_for :users | |
resources :lists do | |
resources :todos | |
end | |
# The priority is based upon order of creation: | |
# first created -> highest priority. | |
# Sample of regular route: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<p id="notice"><%= notice %></p> | |
<p> | |
<%= @list.name %>: | |
</p> | |
<ul> | |
<% @todos.each do |todo| %> | |
<li><%= todo.name %></li> | |
<% end %> | |
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TodosController < ApplicationController | |
# GET /todos | |
# GET /todos.json | |
def index | |
@todos = current_user.lists.find(params[:list_id]).todos | |
respond_to do |format| | |
format.html # index.html.erb | |
format.json { render json: @todos } | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= form_for(@todo) do |f| %> | |
<% if @todo.errors.any? %> | |
<div id="error_explanation"> | |
<h2><%= pluralize(@todo.errors.count, "error") %> prohibited this todo from being saved:</h2> | |
<ul> | |
<% @todo.errors.full_messages.each do |msg| %> | |
<li><%= msg %></li> | |
<% end %> | |
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>New todo</h1> | |
<%= render 'form' %> | |
<%= link_to 'Back', todos_path %> |