summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo k <mo@mokhan.ca>2012-08-26 10:04:37 -0600
committermo k <mo@mokhan.ca>2012-08-26 10:04:37 -0600
commit9383da9773a51c44aec2a44e1cab9b0b46e7cf1a (patch)
treeb68b7ea24783f6f432d0a47445d927647bcfbc5f
parentb3640bddef1f6cc73aaf12c67e3525dbb6f17d98 (diff)
add usermain
-rw-r--r--app/models/user.rb9
-rw-r--r--app/views/home/index.html.erb4
-rw-r--r--app/views/shared/_header.html.erb2
-rw-r--r--db/schema.rb24
4 files changed, 36 insertions, 3 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index 5b54886..720f240 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -1,3 +1,12 @@
class User < ActiveRecord::Base
attr_accessible :name, :provider, :uid
+
+ def self.create_with_omniauth(auth)
+ Rails.logger.info "#{auth}"
+ create! do |user|
+ user.provider = auth["provider"]
+ user.uid = auth["uid"]
+ user.name = auth["info"]["name"]
+ end
+ end
end
diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb
index 64e60ba..daa6548 100644
--- a/app/views/home/index.html.erb
+++ b/app/views/home/index.html.erb
@@ -1,2 +1,2 @@
-<p><%= @key %></p>
-<p><%= @secret %></p>
+<p>the key is: <%= @key %></p>
+<p>the secret is: <%= @secret %></p>
diff --git a/app/views/shared/_header.html.erb b/app/views/shared/_header.html.erb
index d1b9807..4c1ba1a 100644
--- a/app/views/shared/_header.html.erb
+++ b/app/views/shared/_header.html.erb
@@ -6,7 +6,7 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
- <a class="brand" href="/">TechTalk</a>
+ <a class="brand" href="/">TechTalks</a>
<div class="nav-collapse">
<ul class="nav">
<li class="active"><a href="#">About</a></li>
diff --git a/db/schema.rb b/db/schema.rb
new file mode 100644
index 0000000..d733967
--- /dev/null
+++ b/db/schema.rb
@@ -0,0 +1,24 @@
+# encoding: UTF-8
+# This file is auto-generated from the current state of the database. Instead
+# of editing this file, please use the migrations feature of Active Record to
+# incrementally modify your database, and then regenerate this schema definition.
+#
+# Note that this schema.rb definition is the authoritative source for your
+# database schema. If you need to create the application database on another
+# system, you should be using db:schema:load, not running all the migrations
+# from scratch. The latter is a flawed and unsustainable approach (the more migrations
+# you'll amass, the slower it'll run and the greater likelihood for issues).
+#
+# It's strongly recommended to check this file into your version control system.
+
+ActiveRecord::Schema.define(:version => 20120826005440) do
+
+ create_table "users", :force => true do |t|
+ t.string "name"
+ t.string "provider"
+ t.string "uid"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+end