SDA SE Wiki

Software Engineering for Smart Data Analytics & Smart Data Analytics for Software Engineering

User Tools

Site Tools


Clipboard

Please don't place any confidential information in this clipbard (like iPhone code snippets etc.). Use the Confidential Clipboard instead.

Managing the Database

Emergency DB Drop

  1. Login into tztz.org
  2. cd in the project folder (/home/agile/.cruise/projects/scotty2go/work)
  3. enter:
export RAILS_ENV=<scope> ; rake db:drop

and replace <scope> with either test, development, or production resp. depending on the DB you want to drop.

Emergency DB Create

  1. Login into tztz.org
  2. cd in the project folder (/home/agile/.cruise/projects/scotty2go/work)
  3. enter:
export RAILS_ENV=<scope> ; rake db:create

and replace <scope> with either test, development, or production resp. depending on the DB you want to create.

DB rollback (delete tables)

  1. Login into tztz.org
  2. cd in the project folder (/home/agile/.cruise/projects/scotty2go/work)
  3. enter:
export RAILS_ENV=<scope> ; rake db:migrate VERSION=0

and replace <scope> with either test, development, or production resp. depending on the DB you want to rollback.

DB migration (create tables)

  1. Login into tztz.org
  2. cd in the project folder (/home/agile/.cruise/projects/scotty2go/work)
  3. enter:
export RAILS_ENV=<scope> ; rake db:migrate

and replace <scope> with either test, development, or production resp. depending on the DB you want to migrate.

Cocoa stuff

* http://www.cocoadevcentral.com/, especially “Learn Objective-C”, “Objective-C Style”, “C Tutorial for Cocoa” and “Learn Cocoa”.

Rails stuff

controller

def put_via_get_verb
  puts params[:id]
  puts params[:note]
  
  @note = Note.find(params[:id])
  @note.update_attributes(params[:note])
  
  render :text => 'OK'
end
def show
  ...
  
  format.html { render :text => @note.content }
  
  ...
end

routes.rb

map.resources :notes, :collection => { :put_via_get_verb => :get }

GET a note from the Rails server into the iPhone

http://rails.tztz.org/pascal_mark_fdc/notes/2

PUT a note from the iPhone to the Rails server

http://rails.tztz.org/pascal_mark_fdc/notes/put_via_get_verb?id=2&note[content]='Hello World!'
teaching/labs/xp/2008b/clipboard.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2024