From 3d8aa620a5c9b3746585b8dbb3aa37d2819ed5f8 Mon Sep 17 00:00:00 2001 From: kaizheng <18763216000@163.com> Date: Sat, 3 Aug 2013 20:09:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=88=86=E4=BA=AB=E6=8C=89?= =?UTF-8?q?=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/shares_controller.rb | 4 +-- app/models/share.rb | 2 +- app/views/shares/_form.html.erb | 8 ++---- app/views/shares/index.html.erb | 10 +++++--- app/views/shares/show.html.erb | 9 ++----- db/migrate/20130801081314_create_shares.rb | 3 +-- db/schema.rb | 29 ++++++++++++++++------ 7 files changed, 36 insertions(+), 29 deletions(-) diff --git a/app/controllers/shares_controller.rb b/app/controllers/shares_controller.rb index 9a76d26b..55b9e237 100644 --- a/app/controllers/shares_controller.rb +++ b/app/controllers/shares_controller.rb @@ -27,8 +27,8 @@ class SharesController < ApplicationController @share = Share.new #add by mkz 抓取参数传给share - @share[:access_token] = params[:access_token] - @share[:comment] = params[:comment] + + @share[:created_on] = params[:created_on] @share[:title] = params[:title] @share[:url] = params[:url] @share[:share_type] = params[:share_type] diff --git a/app/models/share.rb b/app/models/share.rb index f597ae79..58f4f1aa 100644 --- a/app/models/share.rb +++ b/app/models/share.rb @@ -1,3 +1,3 @@ class Share < ActiveRecord::Base - attr_accessible :access_token, :comment, :share_type, :title, :url + attr_accessible :created_on, :share_type, :title, :url end diff --git a/app/views/shares/_form.html.erb b/app/views/shares/_form.html.erb index 3cf30386..50f680f0 100644 --- a/app/views/shares/_form.html.erb +++ b/app/views/shares/_form.html.erb @@ -12,12 +12,8 @@ <% end %>
Access token | -Comment | +Created On | Url | Title | Share type | @@ -14,8 +13,7 @@ <% @shares.each do |share| %>
---|---|---|---|---|---|
<%= share.access_token %> | -<%= share.comment %> | +<%= share.created_on %> | <%= share.url %> | <%= share.title %> | <%= share.share_type %> | @@ -26,6 +24,10 @@ <% end %>
<%= notice %>
- Access token: - <%= @share.access_token %> -
- -- Comment: - <%= @share.comment %> + Created On: + <%= @share.created_on %>
diff --git a/db/migrate/20130801081314_create_shares.rb b/db/migrate/20130801081314_create_shares.rb index 755de055..00567a1c 100644 --- a/db/migrate/20130801081314_create_shares.rb +++ b/db/migrate/20130801081314_create_shares.rb @@ -1,8 +1,7 @@ class CreateShares < ActiveRecord::Migration def change create_table :shares do |t| - t.string :access_token - t.string :comment + t.date :created_on t.string :url t.string :title t.integer :share_type diff --git a/db/schema.rb b/db/schema.rb index 4bae3d3b..524436fa 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20130801081314) do +ActiveRecord::Schema.define(:version => 20130802011758) do create_table "a_user_watchers", :force => true do |t| t.string "name" @@ -516,13 +516,12 @@ ActiveRecord::Schema.define(:version => 20130801081314) do add_index "settings", ["name"], :name => "index_settings_on_name" create_table "shares", :force => true do |t| - t.string "access_token" - t.string "comment" - t.string "url" + t.date "created_on" t.string "title" - t.integer "share_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.string "share_type" + t.string "url" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false end create_table "students", :force => true do |t| @@ -587,6 +586,22 @@ ActiveRecord::Schema.define(:version => 20130801081314) do t.integer "fields_bits", :default => 0 end + create_table "user_extensions", :force => true do |t| + t.integer "user_id" + t.text "brief_introduction" + t.text "gender" + t.date "birthdate" + t.text "occupation" + t.text "location" + t.integer "zip_code" + t.float "work_experitions" + t.integer "qq" + t.integer "praise_num" + t.integer "tread_num" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "user_preferences", :force => true do |t| t.integer "user_id", :default => 0, :null => false t.text "others"