Skip to content

Instantly share code, notes, and snippets.

@juliend2
Created February 26, 2011 01:42
Show Gist options
  • Save juliend2/844835 to your computer and use it in GitHub Desktop.
Save juliend2/844835 to your computer and use it in GitHub Desktop.
problem with session
require 'camping/session'
Camping.goes :APPNAME
module APPNAME
set :views, File.dirname(__FILE__) + '/views/'
include Camping::Session
end
module APPNAME::Models
class TABLENAME < Base;end
class FieldSetup < V 1.0
def self.up
create_table TABLENAME.table_name do |t|
t.string :name
t.timestamps
end
end
def self.down
drop_table TABLENAME.table_name
end
end
end
module APPNAME::Helpers
def helpername
end
end
module APPNAME::Controllers
class Reset < R '/PATH'
def get
['joie', 'poulet']
end
end
class Index <R '/'
def get
render :index
end
end
class Indexmonth <R '/rest/(.*)/'
def get(month)
render :index
end
end
end
def APPNAME.create
APPNAME::Models.create_schema
Camping::Models::Session.create_schema
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment