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
Creating a rails app "Vurl" | |
http://www.vimeo.com/3761040 | |
(replace vurl with your appname, then Vurl is first model, too) | |
rails -d mysql vurl | |
cd vurl | |
git init | |
cat > .gitignore | |
log/*.log |
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
ActionController::Routing::Routes.draw do |map| | |
map.login 'login', :controller => 'user_sessions', :action => 'new' | |
map.logout 'logout', :controller => 'user_sessions', :action => 'destroy' | |
map.resources :user_sessions | |
map.resources :users | |
map.resources :events | |
map.affiliates_list 'affiliates/list.:format', :controller => "affiliates", :action => "list" | |
map.connect 'affiliates/regenerate_thumb/:id', :controller => "affiliates", :action => "regenerate_thumb" |
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
Last login: Sun Aug 29 13:14:28 on ttys000 | |
dcimac-2:~ Administrator$ cd rails3/geoaccess | |
Changing into a directory with an untrusted .rvmrc | |
Do you wish to trust the rvmrc in this directory? It contains: | |
--- | |
if [[ -n "$rvm_environments_path" && -s "$rvm_environments_path/ruby-1.9.2-head" ]] ; then | |
. "$rvm_environments_path/ruby-1.9.2-head" | |
else | |
rvm --create use "ruby-1.9.2-head" |
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
Last login: Sun Aug 29 14:37:38 on ttys001 | |
dcimac-2:~ Administrator$ cd rails3/sample | |
dcimac-2:sample Administrator$ rvm info | |
ruby-1.9.2-head: | |
system: | |
uname: "Darwin dcimac-2.local 10.4.0 Darwin Kernel Version 10.4.0: Fri Apr 23 18:28:53 PDT 2010; root:xnu-1504.7.4~1/RELEASE_I386 i386 i386" | |
zsh: "zsh 4.3.9 (i386-apple-darwin10.0)" | |
bash: "GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin10.0)" |
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
# == Schema Information | |
# Schema version: 20100906134036 | |
# | |
# Table name: venues | |
# | |
# id :integer not null, primary key | |
# name :string(255) | |
# address :string(255) | |
# city :string(255) | |
# state :string(255) |
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
$(document).ready(function() { | |
var latlng = new google.maps.LatLng(41.857476, -87.6205898); | |
var myOptions = { | |
zoom: <%= @zoom_level %>, | |
center: latlng, | |
mapTypeId: google.maps.MapTypeId.ROADMAP | |
}; | |
var map = new google.maps.Map(document.getElementById("showmap"), | |
myOptions); | |
var marker = new google.maps.Marker({ |
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
resources :directions | |
resources :neighborhoods | |
match '/neighborhood(/:neighborhood_name)', :to => "neighborhood#show", :as => :neighborhood | |
resources :venues | |
match '/about', :to => "pages#about" | |
match "/directions/:start/:destination" => 'directions#show', :as => :get_directions | |
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 DirectionsController < ApplicationController | |
def new | |
@direction = Direction.new | |
@venues = Venue.all | |
end | |
def create | |
@direction = Direction.new(params[:direction]) | |
if @direction.valid? | |
# TODO send direction here |
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>Directions</h1> | |
<p>To go from <%= @start %> to <%= @destination %></p> | |
<ul> | |
<% @directions.xpath('//html_instructions').each do |step| %> | |
<li><%= step.text.html_safe %></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 DirectionsController < ApplicationController | |
def new | |
@direction = Direction.new | |
@venues = Venue.all | |
end | |
def create | |
@direction = Direction.new(params[:direction]) | |
if @direction.valid? | |
# TODO send direction here |
OlderNewer