Permalink
Browse files

Updated

 - Final AJAX example
  • Loading branch information...
1 parent abcbbbc commit 4eca74078fc5e0c0ef9a316683ceb13a51b348a8 @newfront committed Dec 21, 2010
View
3 week_five/faux-twitter/app/views/partials/_add_content_now.html.erb
@@ -1,6 +1,9 @@
<%
#my_info = @status from main_controller
+@user = my_info.user
%>
<div id="add_content_now">
+
+ <p>Welcome to our website,.... <%= @user.username %></p>
<p><%= my_info.status_update %></p>
</div>
View
12 week_five/faux-twitter/config/database.yml
@@ -27,3 +27,15 @@ development:
# database: db/production.sqlite3
# pool: 5
# timeout: 5000
+production:
+ #adapter: sqlite3
+ #database: db/development.sqlite3
+ #pool: 5
+ #timeout: 5000
+ encoding: utf8
+ adapter: mysql2
+ database: dojo-rails
+ pool: 5
+ username: root
+ password:
+ socket: /tmp/mysql.sock
View
8 week_five/faux-twitter/config/environments/development.rb
@@ -4,15 +4,15 @@
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the webserver when you make code changes.
- config.cache_classes = false
+ config.cache_classes = true
# Log error messages when you accidentally call methods on nil.
config.whiny_nils = true
# Show full error reports and disable caching
- config.consider_all_requests_local = true
- config.action_view.debug_rjs = true
- config.action_controller.perform_caching = false
+ config.consider_all_requests_local = false
+ config.action_view.debug_rjs = false
+ config.action_controller.perform_caching = true
# Don't care if the mailer can't send
config.action_mailer.raise_delivery_errors = false
View
2 week_five/faux-twitter/public/javascripts/application.js
@@ -13,7 +13,7 @@ $(document).ready(function()
$.ajax({
type : "GET",
url : "/main/find_me_info",
- data : "what_info=6",
+ data : "what_info=3",
success: function(msg)
{
//alert(msg);
View
25 week_three/notes (Autosaved).rtf
@@ -1,25 +0,0 @@
-{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350
-{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
-{\colortbl;\red255\green255\blue255;}
-\margl1440\margr1440\vieww9000\viewh8400\viewkind0
-\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural
-
-\f0\fs24 \cf0 require 'digest'\
-\
-Digest::SHA1.hexdigest(string)\
-\
->> Digest::SHA1.hexdigest("Scott")\
-=> "2ad0c93dcf651c0afe5e5aa7a8778f7c3ec5769e"\
-\
-\
-protected \
-\
-def encrypted(val)\
- return Digest::SHA1.hexdigest(val.to_s)\
-end\
-\
-----------------------------------\
-\
-Recreate User login\
-1. Add logic to User Model to encrypt the User's name (username)\
-2. Now when a user is added into the database (encrypt the username first)}

0 comments on commit 4eca740

Please sign in to comment.