Changeset 229
- Timestamp:
- 05/03/07 12:33:44 (1 year ago)
- Files:
-
- mrblog/trunk/dist/app/controllers/admin.rb (modified) (1 diff)
- mrblog/trunk/dist/app/controllers/blog.rb (modified) (1 diff)
- mrblog/trunk/dist/app/views/admin/index.herb (modified) (1 diff)
- mrblog/trunk/dist/schema/migrations/002_add_sessions_table.rb (modified) (1 diff)
- mrblog/trunk/dist/schema/schema.rb (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
mrblog/trunk/dist/app/controllers/admin.rb
r153 r229 6 6 def index 7 7 #puts Merb::RenderMixin.erbs.inspect 8 @pager = Merb::Paginator.new(Post.count, M erb::PER_PAGE) do |offset, per_page|8 @pager = Merb::Paginator.new(Post.count, MrBlog::PER_PAGE) do |offset, per_page| 9 9 Post.find(:all, :limit => per_page, :offset => offset, :order => 'created_at DESC') 10 10 end mrblog/trunk/dist/app/controllers/blog.rb
r153 r229 8 8 9 9 def index 10 @pager = Merb::Paginator.new(Post.count, M erb::PER_PAGE) do |offset, per_page|10 @pager = Merb::Paginator.new(Post.count, MrBlog::PER_PAGE) do |offset, per_page| 11 11 Post.find(:all, :limit => per_page, :offset => offset) 12 12 end mrblog/trunk/dist/app/views/admin/index.herb
r143 r229 16 16 <%= link_to("Next", "/admin/index?page=#{@page.next.number}") if @page.next? %></p> 17 17 <%= link_to image_tag('new.gif'), "/admin/new"%> 18 19 20 21 <h1>CHanged!</h1>mrblog/trunk/dist/schema/migrations/002_add_sessions_table.rb
r133 r229 2 2 def self.up 3 3 create_table :sessions, :force => true do |t| 4 t.column :id, :integer, :null => false5 4 t.column :session_id, :string, :limit => 32 6 5 t.column :created_at, :datetime mrblog/trunk/dist/schema/schema.rb
r133 r229 6 6 7 7 create_table "comments", :force => true do |t| 8 t.column "post_id", :integer9 t.column "name", :string10 t.column "body", :text8 t.column "post_id", :integer 9 t.column "name", :string 10 t.column "body", :text 11 11 t.column "created_at", :datetime 12 12 t.column "updated_at", :datetime … … 14 14 15 15 create_table "posts", :force => true do |t| 16 t.column "title", :string17 t.column "body", :text16 t.column "title", :string 17 t.column "body", :text 18 18 t.column "created_at", :datetime 19 19 t.column "updated_at", :datetime 20 t.column "intro", :string20 t.column "intro", :string 21 21 end 22 22 23 23 create_table "sessions", :force => true do |t| 24 t.column "session_id", :string, :limit => 3224 t.column "session_id", :string, :limit => 32 25 25 t.column "created_at", :datetime 26 t.column "data", :text26 t.column "data", :text 27 27 end 28 28 29 add_index "sessions", ["session_id"], :name => "session_id_index"30 29 add_index "sessions", ["session_id"], :name => "sessions_session_id_index" 31 30 32 31 create_table "users", :force => true do |t| 33 t.column "login", :string,:limit => 4034 t.column "email", :string,:limit => 10035 t.column "crypted_password", :string, :limit => 4036 t.column "salt", :string,:limit => 4037 t.column "created_at", :datetime38 t.column "updated_at", :datetime32 t.column "login", :string, :limit => 40 33 t.column "email", :string, :limit => 100 34 t.column "crypted_password", :string, :limit => 40 35 t.column "salt", :string, :limit => 40 36 t.column "created_at", :datetime 37 t.column "updated_at", :datetime 39 38 end 40 39
