Commit ce6c8e0

Tyler Mercier <tylermercier@gmail.com>
2013-06-13 15:49:42
fix view when user missing. update db for using postgres
1 parent 0e443d5
Changed files (2)
app/views/cakes/index.html.erb
@@ -6,7 +6,7 @@
         <div class="thumbnail">
           <a href="<%= url_for cake %>"><%= image_tag cake.photo.url(:thumb), alt: cake.name %></a>
           <div class="caption">
-            <h3><a href="<%= url_for cake %>"><%= cake.name %></a> <small>by <%= cake.user.email %></small></h3>
+            <h3><a href="<%= url_for cake %>"><%= cake.name %></a> <small>by <%= cake.user.email rescue 'N/A' %></small></h3>
             <p><a class="btn" href="<%= url_for cake %>">View</a></p>
             <p><%= cake.category.name rescue 'N/A' %></p>
           </div>
config/database.yml.example
@@ -1,25 +1,32 @@
-# SQLite version 3.x
-#   gem install sqlite3
-#
-#   Ensure the SQLite 3 gem is defined in your Gemfile
-#   gem 'sqlite3'
+# createuser confection_app --superuser --pwprompt --
+# rake db:create:all
+
 development:
-  adapter: sqlite3
-  database: db/development.sqlite3
+  adapter: postgresql
+  encoding: unicode
+  min_messages: warning
+  database: confection_development
+  host: localhost
   pool: 5
-  timeout: 5000
+  username: confection_app
+  password: postgres
 
-# Warning: The database defined as "test" will be erased and
-# re-generated from your development database when you run "rake".
-# Do not set this db to the same as development or production.
 test:
-  adapter: sqlite3
-  database: db/test.sqlite3
+  adapter: postgresql
+  encoding: unicode
+  min_messages: warning
+  database: confection_test
+  host: localhost
   pool: 5
-  timeout: 5000
+  username: confection_app
+  password: postgres
 
 production:
-  adapter: sqlite3
-  database: db/production.sqlite3
+  adapter: postgresql
+  encoding: unicode
+  min_messages: warning
+  database: confection_development
+  host: localhost
   pool: 5
-  timeout: 5000
+  username: confection_app
+  password: postgres