添加分享按钮
This commit is contained in:
parent
a29a84d8a3
commit
3d8aa620a5
|
@ -27,8 +27,8 @@ class SharesController < ApplicationController
|
||||||
@share = Share.new
|
@share = Share.new
|
||||||
|
|
||||||
#add by mkz 抓取参数传给share
|
#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[:title] = params[:title]
|
||||||
@share[:url] = params[:url]
|
@share[:url] = params[:url]
|
||||||
@share[:share_type] = params[:share_type]
|
@share[:share_type] = params[:share_type]
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
class Share < ActiveRecord::Base
|
class Share < ActiveRecord::Base
|
||||||
attr_accessible :access_token, :comment, :share_type, :title, :url
|
attr_accessible :created_on, :share_type, :title, :url
|
||||||
end
|
end
|
||||||
|
|
|
@ -12,12 +12,8 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<%= f.label :access_token %><br />
|
<%= f.label :created_on %><br />
|
||||||
<%= f.text_field :access_token %>
|
<%= f.text_field :created_on %>
|
||||||
</div>
|
|
||||||
<div class="field">
|
|
||||||
<%= f.label :comment %><br />
|
|
||||||
<%= f.text_field :comment %>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<%= f.label :url %><br />
|
<%= f.label :url %><br />
|
||||||
|
|
|
@ -2,8 +2,7 @@
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Access token</th>
|
<th>Created On</th>
|
||||||
<th>Comment</th>
|
|
||||||
<th>Url</th>
|
<th>Url</th>
|
||||||
<th>Title</th>
|
<th>Title</th>
|
||||||
<th>Share type</th>
|
<th>Share type</th>
|
||||||
|
@ -14,8 +13,7 @@
|
||||||
|
|
||||||
<% @shares.each do |share| %>
|
<% @shares.each do |share| %>
|
||||||
<tr>
|
<tr>
|
||||||
<td><%= share.access_token %></td>
|
<td><%= share.created_on %></td>
|
||||||
<td><%= share.comment %></td>
|
|
||||||
<td><%= share.url %></td>
|
<td><%= share.url %></td>
|
||||||
<td><%= share.title %></td>
|
<td><%= share.title %></td>
|
||||||
<td><%= share.share_type %></td>
|
<td><%= share.share_type %></td>
|
||||||
|
@ -26,6 +24,10 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
<a href=javascript:window.open('http://localhost:3000/shares/new?from=3&title='+encodeURIComponent(document.title)+'&url='+encodeURIComponent(document.location.href)+'&jumpback=2&noui=1','favit','');void(0)><img src="genghuancheng" alt="QQshuqian" border="0" height="16" width="16"></a>
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
<%= link_to 'New Share', new_share_path %>
|
<%= link_to 'New Share', new_share_path %>
|
||||||
|
|
||||||
|
<a href=javascript:window.open('http://localhost:3000/shares/new?title='+encodeURIComponent(document.title)+'&url='+encodeURIComponent(document.location.href)+'&jumpback=2&noui=1','favit','');void(0)><img src="genghuancheng" alt="QQshuqian" border="0" height="16" width="16"></a>
|
|
@ -1,13 +1,8 @@
|
||||||
<p id="notice"><%= notice %></p>
|
<p id="notice"><%= notice %></p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<b>Access token:</b>
|
<b>Created On:</b>
|
||||||
<%= @share.access_token %>
|
<%= @share.created_on %>
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
<b>Comment:</b>
|
|
||||||
<%= @share.comment %>
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
class CreateShares < ActiveRecord::Migration
|
class CreateShares < ActiveRecord::Migration
|
||||||
def change
|
def change
|
||||||
create_table :shares do |t|
|
create_table :shares do |t|
|
||||||
t.string :access_token
|
t.date :created_on
|
||||||
t.string :comment
|
|
||||||
t.string :url
|
t.string :url
|
||||||
t.string :title
|
t.string :title
|
||||||
t.integer :share_type
|
t.integer :share_type
|
||||||
|
|
29
db/schema.rb
29
db/schema.rb
|
@ -11,7 +11,7 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended to check this file into your version control system.
|
# 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|
|
create_table "a_user_watchers", :force => true do |t|
|
||||||
t.string "name"
|
t.string "name"
|
||||||
|
@ -516,13 +516,12 @@ ActiveRecord::Schema.define(:version => 20130801081314) do
|
||||||
add_index "settings", ["name"], :name => "index_settings_on_name"
|
add_index "settings", ["name"], :name => "index_settings_on_name"
|
||||||
|
|
||||||
create_table "shares", :force => true do |t|
|
create_table "shares", :force => true do |t|
|
||||||
t.string "access_token"
|
t.date "created_on"
|
||||||
t.string "comment"
|
|
||||||
t.string "url"
|
|
||||||
t.string "title"
|
t.string "title"
|
||||||
t.integer "share_type"
|
t.string "share_type"
|
||||||
t.datetime "created_at", :null => false
|
t.string "url"
|
||||||
t.datetime "updated_at", :null => false
|
t.datetime "created_at", :null => false
|
||||||
|
t.datetime "updated_at", :null => false
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "students", :force => true do |t|
|
create_table "students", :force => true do |t|
|
||||||
|
@ -587,6 +586,22 @@ ActiveRecord::Schema.define(:version => 20130801081314) do
|
||||||
t.integer "fields_bits", :default => 0
|
t.integer "fields_bits", :default => 0
|
||||||
end
|
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|
|
create_table "user_preferences", :force => true do |t|
|
||||||
t.integer "user_id", :default => 0, :null => false
|
t.integer "user_id", :default => 0, :null => false
|
||||||
t.text "others"
|
t.text "others"
|
||||||
|
|
Loading…
Reference in New Issue