Browse files

Add rhosync-api demo

  • Loading branch information...
1 parent 1f04d59 commit 7d7b7ab244c977da0db295f3675a77c47daca677 Brian Moore committed Jul 23, 2010
Showing with 12,204 additions and 0 deletions.
  1. +243 −0 rhosync-api/store-rails/README
  2. +10 −0 rhosync-api/store-rails/Rakefile
  3. +10 −0 rhosync-api/store-rails/app/controllers/application_controller.rb
  4. +87 −0 rhosync-api/store-rails/app/controllers/products_controller.rb
  5. +3 −0 rhosync-api/store-rails/app/helpers/application_helper.rb
  6. +2 −0 rhosync-api/store-rails/app/helpers/products_helper.rb
  7. +58 −0 rhosync-api/store-rails/app/models/product.rb
  8. +17 −0 rhosync-api/store-rails/app/views/layouts/products.html.erb
  9. +32 −0 rhosync-api/store-rails/app/views/products/edit.html.erb
  10. +28 −0 rhosync-api/store-rails/app/views/products/index.html.erb
  11. +31 −0 rhosync-api/store-rails/app/views/products/new.html.erb
  12. +28 −0 rhosync-api/store-rails/app/views/products/show.html.erb
  13. +110 −0 rhosync-api/store-rails/config/boot.rb
  14. +11 −0 rhosync-api/store-rails/config/config.yml
  15. +22 −0 rhosync-api/store-rails/config/database.yml
  16. +41 −0 rhosync-api/store-rails/config/environment.rb
  17. +17 −0 rhosync-api/store-rails/config/environments/development.rb
  18. +28 −0 rhosync-api/store-rails/config/environments/production.rb
  19. +28 −0 rhosync-api/store-rails/config/environments/test.rb
  20. +7 −0 rhosync-api/store-rails/config/initializers/backtrace_silencers.rb
  21. +7 −0 rhosync-api/store-rails/config/initializers/cookie_verification_secret.rb
  22. +10 −0 rhosync-api/store-rails/config/initializers/inflections.rb
  23. +1 −0 rhosync-api/store-rails/config/initializers/load_config.rb
  24. +5 −0 rhosync-api/store-rails/config/initializers/mime_types.rb
  25. +21 −0 rhosync-api/store-rails/config/initializers/new_rails_defaults.rb
  26. +15 −0 rhosync-api/store-rails/config/initializers/session_store.rb
  27. +5 −0 rhosync-api/store-rails/config/locales/en.yml
  28. +45 −0 rhosync-api/store-rails/config/routes.rb
  29. BIN rhosync-api/store-rails/db/development.sqlite3
  30. +17 −0 rhosync-api/store-rails/db/migrate/20100723005631_create_products.rb
  31. +24 −0 rhosync-api/store-rails/db/schema.rb
  32. +7 −0 rhosync-api/store-rails/db/seeds.rb
  33. +2 −0 rhosync-api/store-rails/doc/README_FOR_APP
  34. +957 −0 rhosync-api/store-rails/log/development.log
  35. 0 rhosync-api/store-rails/log/production.log
  36. 0 rhosync-api/store-rails/log/server.log
  37. 0 rhosync-api/store-rails/log/test.log
  38. +30 −0 rhosync-api/store-rails/public/404.html
  39. +30 −0 rhosync-api/store-rails/public/422.html
  40. +30 −0 rhosync-api/store-rails/public/500.html
  41. 0 rhosync-api/store-rails/public/favicon.ico
  42. BIN rhosync-api/store-rails/public/images/rails.png
  43. +275 −0 rhosync-api/store-rails/public/index.html
  44. +2 −0 rhosync-api/store-rails/public/javascripts/application.js
  45. +963 −0 rhosync-api/store-rails/public/javascripts/controls.js
  46. +973 −0 rhosync-api/store-rails/public/javascripts/dragdrop.js
  47. +1,128 −0 rhosync-api/store-rails/public/javascripts/effects.js
  48. +4,320 −0 rhosync-api/store-rails/public/javascripts/prototype.js
  49. +5 −0 rhosync-api/store-rails/public/robots.txt
  50. +54 −0 rhosync-api/store-rails/public/stylesheets/scaffold.css
  51. +4 −0 rhosync-api/store-rails/script/about
  52. +3 −0 rhosync-api/store-rails/script/console
  53. +3 −0 rhosync-api/store-rails/script/dbconsole
  54. +3 −0 rhosync-api/store-rails/script/destroy
  55. +3 −0 rhosync-api/store-rails/script/generate
  56. +3 −0 rhosync-api/store-rails/script/performance/benchmarker
  57. +3 −0 rhosync-api/store-rails/script/performance/profiler
  58. +3 −0 rhosync-api/store-rails/script/plugin
  59. +3 −0 rhosync-api/store-rails/script/runner
  60. +3 −0 rhosync-api/store-rails/script/server
  61. +15 −0 rhosync-api/store-rails/test/fixtures/products.yml
  62. +45 −0 rhosync-api/store-rails/test/functional/products_controller_test.rb
  63. +9 −0 rhosync-api/store-rails/test/performance/browsing_test.rb
  64. +38 −0 rhosync-api/store-rails/test/test_helper.rb
  65. +4 −0 rhosync-api/store-rails/test/unit/helpers/products_helper_test.rb
  66. +8 −0 rhosync-api/store-rails/test/unit/product_test.rb
  67. +19 −0 rhosync-api/store-server/Rakefile
  68. +27 −0 rhosync-api/store-server/application.rb
  69. +33 −0 rhosync-api/store-server/config.ru
  70. +1 −0 rhosync-api/store-server/settings/license.key
  71. +17 −0 rhosync-api/store-server/settings/settings.yml
  72. +38 −0 rhosync-api/store-server/sources/product.rb
  73. +46 −0 rhosync-api/store-server/spec/sources/product_spec.rb
  74. +27 −0 rhosync-api/store-server/spec/spec_helper.rb
  75. +28 −0 rhosync-api/store/Rakefile
  76. +44 −0 rhosync-api/store/app/Product/edit.bb.erb
  77. +43 −0 rhosync-api/store/app/Product/edit.erb
  78. +21 −0 rhosync-api/store/app/Product/index.bb.erb
  79. +23 −0 rhosync-api/store/app/Product/index.erb
  80. +44 −0 rhosync-api/store/app/Product/new.bb.erb
  81. +42 −0 rhosync-api/store/app/Product/new.erb
  82. +8 −0 rhosync-api/store/app/Product/product.rb
  83. +59 −0 rhosync-api/store/app/Product/product_controller.rb
  84. +41 −0 rhosync-api/store/app/Product/show.bb.erb
  85. +39 −0 rhosync-api/store/app/Product/show.erb
  86. +75 −0 rhosync-api/store/app/Settings/controller.rb
  87. +17 −0 rhosync-api/store/app/Settings/home.bb.erb
  88. +23 −0 rhosync-api/store/app/Settings/home.erb
  89. +32 −0 rhosync-api/store/app/Settings/index.bb.erb
  90. +46 −0 rhosync-api/store/app/Settings/index.erb
  91. +35 −0 rhosync-api/store/app/Settings/login.bb.erb
  92. +31 −0 rhosync-api/store/app/Settings/login.erb
  93. +15 −0 rhosync-api/store/app/Settings/reset.bb.erb
  94. +18 −0 rhosync-api/store/app/Settings/reset.erb
  95. +3 −0 rhosync-api/store/app/Settings/wait.bb.erb
  96. +5 −0 rhosync-api/store/app/Settings/wait.erb
  97. +12 −0 rhosync-api/store/app/application.rb
  98. +108 −0 rhosync-api/store/app/helpers/application_helper.rb
  99. +18 −0 rhosync-api/store/app/helpers/browser_helper.rb
  100. +26 −0 rhosync-api/store/app/index.bb.erb
  101. +23 −0 rhosync-api/store/app/index.erb
  102. +25 −0 rhosync-api/store/app/layout.erb
  103. +11 −0 rhosync-api/store/app/loading.html
  104. +7 −0 rhosync-api/store/app/test/product_spec.rb
  105. +16 −0 rhosync-api/store/build.yml
  106. BIN rhosync-api/store/icon/icon.ico
  107. BIN rhosync-api/store/icon/icon.png
  108. +296 −0 rhosync-api/store/public/css/android.css
  109. +115 −0 rhosync-api/store/public/css/blackberry.css
  110. +382 −0 rhosync-api/store/public/css/iphone.css
  111. +41 −0 rhosync-api/store/public/css/webkit.css
  112. +212 −0 rhosync-api/store/public/css/windows_mobile.css
  113. +21 −0 rhosync-api/store/public/images/IUI_LICENSE.txt
  114. BIN rhosync-api/store/public/images/android/btn_check_off.png
  115. BIN rhosync-api/store/public/images/android/btn_check_on.png
  116. BIN rhosync-api/store/public/images/android/btn_radio_off.png
  117. BIN rhosync-api/store/public/images/android/btn_radio_on.png
  118. BIN rhosync-api/store/public/images/android/disclosure.png
  119. BIN rhosync-api/store/public/images/android/ic_menu_more.png
  120. BIN rhosync-api/store/public/images/backButton.png
  121. BIN rhosync-api/store/public/images/blueButton.png
  122. BIN rhosync-api/store/public/images/cancel.png
  123. BIN rhosync-api/store/public/images/grayButton.png
  124. BIN rhosync-api/store/public/images/iphone/disclosure.png
  125. BIN rhosync-api/store/public/images/iphone/disclosure_detail.png
  126. BIN rhosync-api/store/public/images/iphone/radiobutton.png
  127. BIN rhosync-api/store/public/images/iphone/select.png
  128. BIN rhosync-api/store/public/images/iphone/switch.png
  129. BIN rhosync-api/store/public/images/iui-logo-touch-icon.png
  130. BIN rhosync-api/store/public/images/listArrow.png
  131. BIN rhosync-api/store/public/images/listArrowDown.png
  132. BIN rhosync-api/store/public/images/listArrowSel.png
  133. BIN rhosync-api/store/public/images/listGroup.png
  134. BIN rhosync-api/store/public/images/loading.gif
  135. BIN rhosync-api/store/public/images/pinstripes.png
  136. BIN rhosync-api/store/public/images/right_button.png
  137. BIN rhosync-api/store/public/images/selection.png
  138. BIN rhosync-api/store/public/images/thumb.png
  139. BIN rhosync-api/store/public/images/toggle.png
  140. BIN rhosync-api/store/public/images/toggleOn.png
  141. BIN rhosync-api/store/public/images/toolButton.png
  142. BIN rhosync-api/store/public/images/toolButton_new.png
  143. BIN rhosync-api/store/public/images/toolbar.png
  144. BIN rhosync-api/store/public/images/whiteButton.png
  145. +1 −0 rhosync-api/store/public/js/application.js
  146. +4 −0 rhosync-api/store/public/js/rho.js
  147. +59 −0 rhosync-api/store/public/js/rhogeolocation-wm.js
  148. +11 −0 rhosync-api/store/public/js/rhogeolocation.js
  149. +27 −0 rhosync-api/store/rhoconfig.txt
View
243 rhosync-api/store-rails/README
@@ -0,0 +1,243 @@
+== Welcome to Rails
+
+Rails is a web-application framework that includes everything needed to create
+database-backed web applications according to the Model-View-Control pattern.
+
+This pattern splits the view (also called the presentation) into "dumb" templates
+that are primarily responsible for inserting pre-built data in between HTML tags.
+The model contains the "smart" domain objects (such as Account, Product, Person,
+Post) that holds all the business logic and knows how to persist themselves to
+a database. The controller handles the incoming requests (such as Save New Account,
+Update Product, Show Post) by manipulating the model and directing data to the view.
+
+In Rails, the model is handled by what's called an object-relational mapping
+layer entitled Active Record. This layer allows you to present the data from
+database rows as objects and embellish these data objects with business logic
+methods. You can read more about Active Record in
+link:files/vendor/rails/activerecord/README.html.
+
+The controller and view are handled by the Action Pack, which handles both
+layers by its two parts: Action View and Action Controller. These two layers
+are bundled in a single package due to their heavy interdependence. This is
+unlike the relationship between the Active Record and Action Pack that is much
+more separate. Each of these packages can be used independently outside of
+Rails. You can read more about Action Pack in
+link:files/vendor/rails/actionpack/README.html.
+
+
+== Getting Started
+
+1. At the command prompt, start a new Rails application using the <tt>rails</tt> command
+ and your application name. Ex: rails myapp
+2. Change directory into myapp and start the web server: <tt>script/server</tt> (run with --help for options)
+3. Go to http://localhost:3000/ and get "Welcome aboard: You're riding the Rails!"
+4. Follow the guidelines to start developing your application
+
+
+== Web Servers
+
+By default, Rails will try to use Mongrel if it's are installed when started with script/server, otherwise Rails will use WEBrick, the webserver that ships with Ruby. But you can also use Rails
+with a variety of other web servers.
+
+Mongrel is a Ruby-based webserver with a C component (which requires compilation) that is
+suitable for development and deployment of Rails applications. If you have Ruby Gems installed,
+getting up and running with mongrel is as easy as: <tt>gem install mongrel</tt>.
+More info at: http://mongrel.rubyforge.org
+
+Say other Ruby web servers like Thin and Ebb or regular web servers like Apache or LiteSpeed or
+Lighttpd or IIS. The Ruby web servers are run through Rack and the latter can either be setup to use
+FCGI or proxy to a pack of Mongrels/Thin/Ebb servers.
+
+== Apache .htaccess example for FCGI/CGI
+
+# General Apache options
+AddHandler fastcgi-script .fcgi
+AddHandler cgi-script .cgi
+Options +FollowSymLinks +ExecCGI
+
+# If you don't want Rails to look in certain directories,
+# use the following rewrite rules so that Apache won't rewrite certain requests
+#
+# Example:
+# RewriteCond %{REQUEST_URI} ^/notrails.*
+# RewriteRule .* - [L]
+
+# Redirect all requests not available on the filesystem to Rails
+# By default the cgi dispatcher is used which is very slow
+#
+# For better performance replace the dispatcher with the fastcgi one
+#
+# Example:
+# RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
+RewriteEngine On
+
+# If your Rails application is accessed via an Alias directive,
+# then you MUST also set the RewriteBase in this htaccess file.
+#
+# Example:
+# Alias /myrailsapp /path/to/myrailsapp/public
+# RewriteBase /myrailsapp
+
+RewriteRule ^$ index.html [QSA]
+RewriteRule ^([^.]+)$ $1.html [QSA]
+RewriteCond %{REQUEST_FILENAME} !-f
+RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
+
+# In case Rails experiences terminal errors
+# Instead of displaying this message you can supply a file here which will be rendered instead
+#
+# Example:
+# ErrorDocument 500 /500.html
+
+ErrorDocument 500 "<h2>Application error</h2>Rails application failed to start properly"
+
+
+== Debugging Rails
+
+Sometimes your application goes wrong. Fortunately there are a lot of tools that
+will help you debug it and get it back on the rails.
+
+First area to check is the application log files. Have "tail -f" commands running
+on the server.log and development.log. Rails will automatically display debugging
+and runtime information to these files. Debugging info will also be shown in the
+browser on requests from 127.0.0.1.
+
+You can also log your own messages directly into the log file from your code using
+the Ruby logger class from inside your controllers. Example:
+
+ class WeblogController < ActionController::Base
+ def destroy
+ @weblog = Weblog.find(params[:id])
+ @weblog.destroy
+ logger.info("#{Time.now} Destroyed Weblog ID ##{@weblog.id}!")
+ end
+ end
+
+The result will be a message in your log file along the lines of:
+
+ Mon Oct 08 14:22:29 +1000 2007 Destroyed Weblog ID #1
+
+More information on how to use the logger is at http://www.ruby-doc.org/core/
+
+Also, Ruby documentation can be found at http://www.ruby-lang.org/ including:
+
+* The Learning Ruby (Pickaxe) Book: http://www.ruby-doc.org/docs/ProgrammingRuby/
+* Learn to Program: http://pine.fm/LearnToProgram/ (a beginners guide)
+
+These two online (and free) books will bring you up to speed on the Ruby language
+and also on programming in general.
+
+
+== Debugger
+
+Debugger support is available through the debugger command when you start your Mongrel or
+Webrick server with --debugger. This means that you can break out of execution at any point
+in the code, investigate and change the model, AND then resume execution!
+You need to install ruby-debug to run the server in debugging mode. With gems, use 'gem install ruby-debug'
+Example:
+
+ class WeblogController < ActionController::Base
+ def index
+ @posts = Post.find(:all)
+ debugger
+ end
+ end
+
+So the controller will accept the action, run the first line, then present you
+with a IRB prompt in the server window. Here you can do things like:
+
+ >> @posts.inspect
+ => "[#<Post:0x14a6be8 @attributes={\"title\"=>nil, \"body\"=>nil, \"id\"=>\"1\"}>,
+ #<Post:0x14a6620 @attributes={\"title\"=>\"Rails you know!\", \"body\"=>\"Only ten..\", \"id\"=>\"2\"}>]"
+ >> @posts.first.title = "hello from a debugger"
+ => "hello from a debugger"
+
+...and even better is that you can examine how your runtime objects actually work:
+
+ >> f = @posts.first
+ => #<Post:0x13630c4 @attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>
+ >> f.
+ Display all 152 possibilities? (y or n)
+
+Finally, when you're ready to resume execution, you enter "cont"
+
+
+== Console
+
+You can interact with the domain model by starting the console through <tt>script/console</tt>.
+Here you'll have all parts of the application configured, just like it is when the
+application is running. You can inspect domain models, change values, and save to the
+database. Starting the script without arguments will launch it in the development environment.
+Passing an argument will specify a different environment, like <tt>script/console production</tt>.
+
+To reload your controllers and models after launching the console run <tt>reload!</tt>
+
+== dbconsole
+
+You can go to the command line of your database directly through <tt>script/dbconsole</tt>.
+You would be connected to the database with the credentials defined in database.yml.
+Starting the script without arguments will connect you to the development database. Passing an
+argument will connect you to a different database, like <tt>script/dbconsole production</tt>.
+Currently works for mysql, postgresql and sqlite.
+
+== Description of Contents
+
+app
+ Holds all the code that's specific to this particular application.
+
+app/controllers
+ Holds controllers that should be named like weblogs_controller.rb for
+ automated URL mapping. All controllers should descend from ApplicationController
+ which itself descends from ActionController::Base.
+
+app/models
+ Holds models that should be named like post.rb.
+ Most models will descend from ActiveRecord::Base.
+
+app/views
+ Holds the template files for the view that should be named like
+ weblogs/index.html.erb for the WeblogsController#index action. All views use eRuby
+ syntax.
+
+app/views/layouts
+ Holds the template files for layouts to be used with views. This models the common
+ header/footer method of wrapping views. In your views, define a layout using the
+ <tt>layout :default</tt> and create a file named default.html.erb. Inside default.html.erb,
+ call <% yield %> to render the view using this layout.
+
+app/helpers
+ Holds view helpers that should be named like weblogs_helper.rb. These are generated
+ for you automatically when using script/generate for controllers. Helpers can be used to
+ wrap functionality for your views into methods.
+
+config
+ Configuration files for the Rails environment, the routing map, the database, and other dependencies.
+
+db
+ Contains the database schema in schema.rb. db/migrate contains all
+ the sequence of Migrations for your schema.
+
+doc
+ This directory is where your application documentation will be stored when generated
+ using <tt>rake doc:app</tt>
+
+lib
+ Application specific libraries. Basically, any kind of custom code that doesn't
+ belong under controllers, models, or helpers. This directory is in the load path.
+
+public
+ The directory available for the web server. Contains subdirectories for images, stylesheets,
+ and javascripts. Also contains the dispatchers and the default HTML files. This should be
+ set as the DOCUMENT_ROOT of your web server.
+
+script
+ Helper scripts for automation and generation.
+
+test
+ Unit and functional tests along with fixtures. When using the script/generate scripts, template
+ test files will be generated for you and placed in this directory.
+
+vendor
+ External libraries that the application depends on. Also includes the plugins subdirectory.
+ If the app has frozen rails, those gems also go here, under vendor/rails/.
+ This directory is in the load path.
View
10 rhosync-api/store-rails/Rakefile
@@ -0,0 +1,10 @@
+# Add your own tasks in files placed in lib/tasks ending in .rake,
+# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
+
+require(File.join(File.dirname(__FILE__), 'config', 'boot'))
+
+require 'rake'
+require 'rake/testtask'
+require 'rake/rdoctask'
+
+require 'tasks/rails'
View
10 rhosync-api/store-rails/app/controllers/application_controller.rb
@@ -0,0 +1,10 @@
+# Filters added to this controller apply to all controllers in the application.
+# Likewise, all the methods added will be available for all controllers.
+
+class ApplicationController < ActionController::Base
+ helper :all # include all helpers, all the time
+ protect_from_forgery # See ActionController::RequestForgeryProtection for details
+
+ # Scrub sensitive parameters from your log
+ # filter_parameter_logging :password
+end
View
87 rhosync-api/store-rails/app/controllers/products_controller.rb
@@ -0,0 +1,87 @@
+class ProductsController < ApplicationController
+
+ protect_from_forgery :except => [:create, :update, :delete]
+ # GET /products
+ # GET /products.xml
+ def index
+ @products = Product.all
+
+ respond_to do |format|
+ format.html # index.html.erb
+ format.xml { render :xml => @products }
+ format.json { render :json => @products }
+ end
+ end
+
+ # GET /products/1
+ # GET /products/1.xml
+ def show
+ @product = Product.find(params[:id])
+
+ respond_to do |format|
+ format.html # show.html.erb
+ format.xml { render :xml => @product }
+ format.json { render :json => @product }
+ end
+ end
+
+ # GET /products/new
+ # GET /products/new.xml
+ def new
+ @product = Product.new
+
+ respond_to do |format|
+ format.html # new.html.erb
+ format.xml { render :xml => @product }
+ end
+ end
+
+ # GET /products/1/edit
+ def edit
+ @product = Product.find(params[:id])
+ end
+
+ # POST /products
+ # POST /products.xml
+ def create
+ @product = Product.new(params[:product])
+
+ respond_to do |format|
+ if @product.save
+ format.html { redirect_to(@product, :notice => 'Product was successfully created.') }
+ format.xml { render :xml => @product, :status => :created, :location => @product }
+ else
+ format.html { render :action => "new" }
+ format.xml { render :xml => @product.errors, :status => :unprocessable_entity }
+ end
+ end
+ end
+
+ # PUT /products/1
+ # PUT /products/1.xml
+ def update
+ @product = Product.find(params[:id])
+
+ respond_to do |format|
+ if @product.update_attributes(params[:product])
+ format.html { redirect_to(@product, :notice => 'Product was successfully updated.') }
+ format.xml { head :ok }
+ else
+ format.html { render :action => "edit" }
+ format.xml { render :xml => @product.errors, :status => :unprocessable_entity }
+ end
+ end
+ end
+
+ # DELETE /products/1
+ # DELETE /products/1.xml
+ def destroy
+ @product = Product.find(params[:id])
+ @product.destroy
+
+ respond_to do |format|
+ format.html { redirect_to(products_url) }
+ format.xml { head :ok }
+ end
+ end
+end
View
3 rhosync-api/store-rails/app/helpers/application_helper.rb
@@ -0,0 +1,3 @@
+# Methods added to this helper will be available to all templates in the application.
+module ApplicationHelper
+end
View
2 rhosync-api/store-rails/app/helpers/products_helper.rb
@@ -0,0 +1,2 @@
+module ProductsHelper
+end
View
58 rhosync-api/store-rails/app/models/product.rb
@@ -0,0 +1,58 @@
+require 'rest-client'
+class Product < ActiveRecord::Base
+
+ after_create :push_rhosync_create
+ after_update :push_rhosync_update
+ after_destroy :push_rhosync_delete
+
+ def push_rhosync_create
+ create = {
+ :api_token => AppConfig['rhosync_api_key'],
+ :user_id => 't', :source_id => 'Product',
+ :objects => {
+ self.id.to_s => JSON.parse(self.to_json)['product']
+ }
+ }
+ RestClient.post(
+ "#{AppConfig['rhosync_url']}/api/push_objects",
+ create.to_json,
+ :content_type => :json
+ )
+ end
+
+ def push_rhosync_update
+ delete = {
+ :api_token => AppConfig['rhosync_api_key'],
+ :user_id => 't', :source_id => 'Product',
+ :objects => [self.id.to_s]
+ }
+ RestClient.post(
+ "#{AppConfig['rhosync_url']}/api/push_deletes",
+ delete.to_json,
+ :content_type => :json
+ )
+ update = {
+ :api_token => AppConfig['rhosync_api_key'],
+ :user_id => 't', :source_id => 'Product',
+ :objects => { self.id.to_s => JSON.parse(self.to_json)['product'] }
+ }
+ RestClient.post(
+ "#{AppConfig['rhosync_url']}/api/push_objects",
+ update.to_json,
+ :content_type => :json
+ )
+ end
+
+ def push_rhosync_delete
+ delete = {
+ :api_token => AppConfig['rhosync_api_key'],
+ :user_id => 't', :source_id => 'Product',
+ :objects => [self.id.to_s]
+ }
+ RestClient.post(
+ "#{AppConfig['rhosync_url']}/api/push_deletes",
+ delete.to_json,
+ :content_type => :json
+ )
+ end
+end
View
17 rhosync-api/store-rails/app/views/layouts/products.html.erb
@@ -0,0 +1,17 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
+ <title>Products: <%= controller.action_name %></title>
+ <%= stylesheet_link_tag 'scaffold' %>
+</head>
+<body>
+
+<p style="color: green"><%= notice %></p>
+
+<%= yield %>
+
+</body>
+</html>
View
32 rhosync-api/store-rails/app/views/products/edit.html.erb
@@ -0,0 +1,32 @@
+<h1>Editing product</h1>
+
+<% form_for(@product) do |f| %>
+ <%= f.error_messages %>
+
+ <p>
+ <%= f.label :name %><br />
+ <%= f.text_field :name %>
+ </p>
+ <p>
+ <%= f.label :brand %><br />
+ <%= f.text_field :brand %>
+ </p>
+ <p>
+ <%= f.label :price %><br />
+ <%= f.text_field :price %>
+ </p>
+ <p>
+ <%= f.label :quantity %><br />
+ <%= f.text_field :quantity %>
+ </p>
+ <p>
+ <%= f.label :sku %><br />
+ <%= f.text_field :sku %>
+ </p>
+ <p>
+ <%= f.submit 'Update' %>
+ </p>
+<% end %>
+
+<%= link_to 'Show', @product %> |
+<%= link_to 'Back', products_path %>
View
28 rhosync-api/store-rails/app/views/products/index.html.erb
@@ -0,0 +1,28 @@
+<h1>Listing products</h1>
+
+<table>
+ <tr>
+ <th>Name</th>
+ <th>Brand</th>
+ <th>Price</th>
+ <th>Quantity</th>
+ <th>Sku</th>
+ </tr>
+
+<% @products.each do |product| %>
+ <tr>
+ <td><%=h product.name %></td>
+ <td><%=h product.brand %></td>
+ <td><%=h product.price %></td>
+ <td><%=h product.quantity %></td>
+ <td><%=h product.sku %></td>
+ <td><%= link_to 'Show', product %></td>
+ <td><%= link_to 'Edit', edit_product_path(product) %></td>
+ <td><%= link_to 'Destroy', product, :confirm => 'Are you sure?', :method => :delete %></td>
+ </tr>
+<% end %>
+</table>
+
+<br />
+
+<%= link_to 'New product', new_product_path %>
View
31 rhosync-api/store-rails/app/views/products/new.html.erb
@@ -0,0 +1,31 @@
+<h1>New product</h1>
+
+<% form_for(@product) do |f| %>
+ <%= f.error_messages %>
+
+ <p>
+ <%= f.label :name %><br />
+ <%= f.text_field :name %>
+ </p>
+ <p>
+ <%= f.label :brand %><br />
+ <%= f.text_field :brand %>
+ </p>
+ <p>
+ <%= f.label :price %><br />
+ <%= f.text_field :price %>
+ </p>
+ <p>
+ <%= f.label :quantity %><br />
+ <%= f.text_field :quantity %>
+ </p>
+ <p>
+ <%= f.label :sku %><br />
+ <%= f.text_field :sku %>
+ </p>
+ <p>
+ <%= f.submit 'Create' %>
+ </p>
+<% end %>
+
+<%= link_to 'Back', products_path %>
View
28 rhosync-api/store-rails/app/views/products/show.html.erb
@@ -0,0 +1,28 @@
+<p>
+ <b>Name:</b>
+ <%=h @product.name %>
+</p>
+
+<p>
+ <b>Brand:</b>
+ <%=h @product.brand %>
+</p>
+
+<p>
+ <b>Price:</b>
+ <%=h @product.price %>
+</p>
+
+<p>
+ <b>Quantity:</b>
+ <%=h @product.quantity %>
+</p>
+
+<p>
+ <b>Sku:</b>
+ <%=h @product.sku %>
+</p>
+
+
+<%= link_to 'Edit', edit_product_path(@product) %> |
+<%= link_to 'Back', products_path %>
View
110 rhosync-api/store-rails/config/boot.rb
@@ -0,0 +1,110 @@
+# Don't change this file!
+# Configure your app in config/environment.rb and config/environments/*.rb
+
+RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
+
+module Rails
+ class << self
+ def boot!
+ unless booted?
+ preinitialize
+ pick_boot.run
+ end
+ end
+
+ def booted?
+ defined? Rails::Initializer
+ end
+
+ def pick_boot
+ (vendor_rails? ? VendorBoot : GemBoot).new
+ end
+
+ def vendor_rails?
+ File.exist?("#{RAILS_ROOT}/vendor/rails")
+ end
+
+ def preinitialize
+ load(preinitializer_path) if File.exist?(preinitializer_path)
+ end
+
+ def preinitializer_path
+ "#{RAILS_ROOT}/config/preinitializer.rb"
+ end
+ end
+
+ class Boot
+ def run
+ load_initializer
+ Rails::Initializer.run(:set_load_path)
+ end
+ end
+
+ class VendorBoot < Boot
+ def load_initializer
+ require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
+ Rails::Initializer.run(:install_gem_spec_stubs)
+ Rails::GemDependency.add_frozen_gem_path
+ end
+ end
+
+ class GemBoot < Boot
+ def load_initializer
+ self.class.load_rubygems
+ load_rails_gem
+ require 'initializer'
+ end
+
+ def load_rails_gem
+ if version = self.class.gem_version
+ gem 'rails', version
+ else
+ gem 'rails'
+ end
+ rescue Gem::LoadError => load_error
+ $stderr.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.)
+ exit 1
+ end
+
+ class << self
+ def rubygems_version
+ Gem::RubyGemsVersion rescue nil
+ end
+
+ def gem_version
+ if defined? RAILS_GEM_VERSION
+ RAILS_GEM_VERSION
+ elsif ENV.include?('RAILS_GEM_VERSION')
+ ENV['RAILS_GEM_VERSION']
+ else
+ parse_gem_version(read_environment_rb)
+ end
+ end
+
+ def load_rubygems
+ min_version = '1.3.2'
+ require 'rubygems'
+ unless rubygems_version >= min_version
+ $stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.)
+ exit 1
+ end
+
+ rescue LoadError
+ $stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org)
+ exit 1
+ end
+
+ def parse_gem_version(text)
+ $1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
+ end
+
+ private
+ def read_environment_rb
+ File.read("#{RAILS_ROOT}/config/environment.rb")
+ end
+ end
+ end
+end
+
+# All that for this:
+Rails.boot!
View
11 rhosync-api/store-rails/config/config.yml
@@ -0,0 +1,11 @@
+development:
+ rhosync_api_key: 069d6f3b15ce4e158463c772ce1d91d2
+ rhosync_url: http://localhost:9292
+
+test: &test
+ rhosync_api_key: 069d6f3b15ce4e158463c772ce1d91d2
+ rhosync_url: http://localhost:9292
+
+production:
+ rhosync_api_key: 069d6f3b15ce4e158463c772ce1d91d2
+ rhosync_url: http://localhost:9292
View
22 rhosync-api/store-rails/config/database.yml
@@ -0,0 +1,22 @@
+# SQLite version 3.x
+# gem install sqlite3-ruby (not necessary on OS X Leopard)
+development:
+ adapter: sqlite3
+ database: db/development.sqlite3
+ pool: 5
+ timeout: 5000
+
+# 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
+ pool: 5
+ timeout: 5000
+
+production:
+ adapter: sqlite3
+ database: db/production.sqlite3
+ pool: 5
+ timeout: 5000
View
41 rhosync-api/store-rails/config/environment.rb
@@ -0,0 +1,41 @@
+# Be sure to restart your server when you modify this file
+
+# Specifies gem version of Rails to use when vendor/rails is not present
+RAILS_GEM_VERSION = '2.3.8' unless defined? RAILS_GEM_VERSION
+
+# Bootstrap the Rails environment, frameworks, and default configuration
+require File.join(File.dirname(__FILE__), 'boot')
+
+Rails::Initializer.run do |config|
+ # Settings in config/environments/* take precedence over those specified here.
+ # Application configuration should go into files in config/initializers
+ # -- all .rb files in that directory are automatically loaded.
+
+ # Add additional load paths for your own custom dirs
+ # config.load_paths += %W( #{RAILS_ROOT}/extras )
+
+ # Specify gems that this application depends on and have them installed with rake gems:install
+ # config.gem "bj"
+ # config.gem "hpricot", :version => '0.6', :source => "http://code.whytheluckystiff.net"
+ # config.gem "sqlite3-ruby", :lib => "sqlite3"
+ # config.gem "aws-s3", :lib => "aws/s3"
+
+ # Only load the plugins named here, in the order given (default is alphabetical).
+ # :all can be used as a placeholder for all plugins not explicitly named
+ # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
+
+ # Skip frameworks you're not going to use. To use Rails without a database,
+ # you must remove the Active Record framework.
+ # config.frameworks -= [ :active_record, :active_resource, :action_mailer ]
+
+ # Activate observers that should always be running
+ # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
+
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
+ # Run "rake -D time" for a list of tasks for finding time zone names.
+ config.time_zone = 'UTC'
+
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}')]
+ # config.i18n.default_locale = :de
+end
View
17 rhosync-api/store-rails/config/environments/development.rb
@@ -0,0 +1,17 @@
+# Settings specified here will take precedence over those in config/environment.rb
+
+# 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
+
+# Log error messages when you accidentally call methods on nil.
+config.whiny_nils = true
+
+# Show full error reports and disable caching
+config.action_controller.consider_all_requests_local = true
+config.action_view.debug_rjs = true
+config.action_controller.perform_caching = false
+
+# Don't care if the mailer can't send
+config.action_mailer.raise_delivery_errors = false
View
28 rhosync-api/store-rails/config/environments/production.rb
@@ -0,0 +1,28 @@
+# Settings specified here will take precedence over those in config/environment.rb
+
+# The production environment is meant for finished, "live" apps.
+# Code is not reloaded between requests
+config.cache_classes = true
+
+# Full error reports are disabled and caching is turned on
+config.action_controller.consider_all_requests_local = false
+config.action_controller.perform_caching = true
+config.action_view.cache_template_loading = true
+
+# See everything in the log (default is :info)
+# config.log_level = :debug
+
+# Use a different logger for distributed setups
+# config.logger = SyslogLogger.new
+
+# Use a different cache store in production
+# config.cache_store = :mem_cache_store
+
+# Enable serving of images, stylesheets, and javascripts from an asset server
+# config.action_controller.asset_host = "http://assets.example.com"
+
+# Disable delivery errors, bad email addresses will be ignored
+# config.action_mailer.raise_delivery_errors = false
+
+# Enable threaded mode
+# config.threadsafe!
View
28 rhosync-api/store-rails/config/environments/test.rb
@@ -0,0 +1,28 @@
+# Settings specified here will take precedence over those in config/environment.rb
+
+# The test environment is used exclusively to run your application's
+# test suite. You never need to work with it otherwise. Remember that
+# your test database is "scratch space" for the test suite and is wiped
+# and recreated between test runs. Don't rely on the data there!
+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.action_controller.consider_all_requests_local = true
+config.action_controller.perform_caching = false
+config.action_view.cache_template_loading = true
+
+# Disable request forgery protection in test environment
+config.action_controller.allow_forgery_protection = false
+
+# Tell Action Mailer not to deliver emails to the real world.
+# The :test delivery method accumulates sent emails in the
+# ActionMailer::Base.deliveries array.
+config.action_mailer.delivery_method = :test
+
+# Use SQL instead of Active Record's schema dumper when creating the test database.
+# This is necessary if your schema can't be completely dumped by the schema dumper,
+# like if you have constraints or database-specific column types
+# config.active_record.schema_format = :sql
View
7 rhosync-api/store-rails/config/initializers/backtrace_silencers.rb
@@ -0,0 +1,7 @@
+# Be sure to restart your server when you modify this file.
+
+# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
+# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
+
+# You can also remove all the silencers if you're trying do debug a problem that might steem from framework code.
+# Rails.backtrace_cleaner.remove_silencers!
View
7 rhosync-api/store-rails/config/initializers/cookie_verification_secret.rb
@@ -0,0 +1,7 @@
+# Be sure to restart your server when you modify this file.
+
+# Your secret key for verifying the integrity of signed cookies.
+# If you change this key, all old signed cookies will become invalid!
+# Make sure the secret is at least 30 characters and all random,
+# no regular words or you'll be exposed to dictionary attacks.
+ActionController::Base.cookie_verifier_secret = '7e20e76ac9bea2787027017114b723e6ebcb7f279ec27ce446ede250e010b0b541fea133792ea94cc4e2100762240b567f878bf252e4936d727168916602fbcc';
View
10 rhosync-api/store-rails/config/initializers/inflections.rb
@@ -0,0 +1,10 @@
+# Be sure to restart your server when you modify this file.
+
+# Add new inflection rules using the following format
+# (all these examples are active by default):
+# ActiveSupport::Inflector.inflections do |inflect|
+# inflect.plural /^(ox)$/i, '\1en'
+# inflect.singular /^(ox)en/i, '\1'
+# inflect.irregular 'person', 'people'
+# inflect.uncountable %w( fish sheep )
+# end
View
1 rhosync-api/store-rails/config/initializers/load_config.rb
@@ -0,0 +1 @@
+AppConfig = YAML.load_file(File.join(Rails.root, 'config', 'config.yml'))[Rails.env]
View
5 rhosync-api/store-rails/config/initializers/mime_types.rb
@@ -0,0 +1,5 @@
+# Be sure to restart your server when you modify this file.
+
+# Add new mime types for use in respond_to blocks:
+# Mime::Type.register "text/richtext", :rtf
+# Mime::Type.register_alias "text/html", :iphone
View
21 rhosync-api/store-rails/config/initializers/new_rails_defaults.rb
@@ -0,0 +1,21 @@
+# Be sure to restart your server when you modify this file.
+
+# These settings change the behavior of Rails 2 apps and will be defaults
+# for Rails 3. You can remove this initializer when Rails 3 is released.
+
+if defined?(ActiveRecord)
+ # Include Active Record class name as root for JSON serialized output.
+ ActiveRecord::Base.include_root_in_json = true
+
+ # Store the full class name (including module namespace) in STI type column.
+ ActiveRecord::Base.store_full_sti_class = true
+end
+
+ActionController::Routing.generate_best_match = false
+
+# Use ISO 8601 format for JSON serialized times and dates.
+ActiveSupport.use_standard_json_time_format = true
+
+# Don't escape HTML entities in JSON, leave that for the #json_escape helper.
+# if you're including raw json in an HTML page.
+ActiveSupport.escape_html_entities_in_json = false
View
15 rhosync-api/store-rails/config/initializers/session_store.rb
@@ -0,0 +1,15 @@
+# Be sure to restart your server when you modify this file.
+
+# Your secret key for verifying cookie session data integrity.
+# If you change this key, all old sessions will become invalid!
+# Make sure the secret is at least 30 characters and all random,
+# no regular words or you'll be exposed to dictionary attacks.
+ActionController::Base.session = {
+ :key => '_store-rails_session',
+ :secret => '77fe7ade97c00922285109b9cbd927758a11b9d56d98881148958918a87c97bfcdc8fac030e44be8692af528a89ce7886d53fb3d59e38f01829bd1f781432a89'
+}
+
+# Use the database for sessions instead of the cookie-based default,
+# which shouldn't be used to store highly confidential information
+# (create the session table with "rake db:sessions:create")
+# ActionController::Base.session_store = :active_record_store
View
5 rhosync-api/store-rails/config/locales/en.yml
@@ -0,0 +1,5 @@
+# Sample localization file for English. Add more files in this directory for other locales.
+# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
+
+en:
+ hello: "Hello world"
View
45 rhosync-api/store-rails/config/routes.rb
@@ -0,0 +1,45 @@
+ActionController::Routing::Routes.draw do |map|
+ map.resources :products
+
+ # The priority is based upon order of creation: first created -> highest priority.
+
+ # Sample of regular route:
+ # map.connect 'products/:id', :controller => 'catalog', :action => 'view'
+ # Keep in mind you can assign values other than :controller and :action
+
+ # Sample of named route:
+ # map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase'
+ # This route can be invoked with purchase_url(:id => product.id)
+
+ # Sample resource route (maps HTTP verbs to controller actions automatically):
+ # map.resources :products
+
+ # Sample resource route with options:
+ # map.resources :products, :member => { :short => :get, :toggle => :post }, :collection => { :sold => :get }
+
+ # Sample resource route with sub-resources:
+ # map.resources :products, :has_many => [ :comments, :sales ], :has_one => :seller
+
+ # Sample resource route with more complex sub-resources
+ # map.resources :products do |products|
+ # products.resources :comments
+ # products.resources :sales, :collection => { :recent => :get }
+ # end
+
+ # Sample resource route within a namespace:
+ # map.namespace :admin do |admin|
+ # # Directs /admin/products/* to Admin::ProductsController (app/controllers/admin/products_controller.rb)
+ # admin.resources :products
+ # end
+
+ # You can have the root of your site routed with map.root -- just remember to delete public/index.html.
+ # map.root :controller => "welcome"
+
+ # See how all your routes lay out with "rake routes"
+
+ # Install the default routes as the lowest priority.
+ # Note: These default routes make all actions in every controller accessible via GET requests. You should
+ # consider removing or commenting them out if you're using named routes and resources.
+ map.connect ':controller/:action/:id'
+ map.connect ':controller/:action/:id.:format'
+end
View
BIN rhosync-api/store-rails/db/development.sqlite3
Binary file not shown.
View
17 rhosync-api/store-rails/db/migrate/20100723005631_create_products.rb
@@ -0,0 +1,17 @@
+class CreateProducts < ActiveRecord::Migration
+ def self.up
+ create_table :products do |t|
+ t.string :name
+ t.string :brand
+ t.string :price
+ t.string :quantity
+ t.string :sku
+
+ t.timestamps
+ end
+ end
+
+ def self.down
+ drop_table :products
+ end
+end
View
24 rhosync-api/store-rails/db/schema.rb
@@ -0,0 +1,24 @@
+# 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 => 20100723005631) do
+
+ create_table "products", :force => true do |t|
+ t.string "name"
+ t.string "brand"
+ t.string "price"
+ t.string "quantity"
+ t.string "sku"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+end
View
7 rhosync-api/store-rails/db/seeds.rb
@@ -0,0 +1,7 @@
+# This file should contain all the record creation needed to seed the database with its default values.
+# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
+#
+# Examples:
+#
+# cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }])
+# Major.create(:name => 'Daley', :city => cities.first)
View
2 rhosync-api/store-rails/doc/README_FOR_APP
@@ -0,0 +1,2 @@
+Use this README file to introduce your application and point to useful places in the API for learning more.
+Run "rake doc:app" to generate API documentation for your models, controllers, helpers, and libraries.
View
957 rhosync-api/store-rails/log/development.log
@@ -0,0 +1,957 @@
+ SQL (0.3ms)  SELECT name
+ FROM sqlite_master
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
+
+ SQL (0.2ms) select sqlite_version(*)
+ SQL (2.4ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
+ SQL (0.1ms) PRAGMA index_list("schema_migrations")
+ SQL (2.5ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
+ SQL (0.4ms)  SELECT name
+ FROM sqlite_master
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
+
+ SQL (0.2ms) SELECT version FROM schema_migrations
+Migrating to CreateProducts (20100723005631)
+ SQL (0.5ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "brand" varchar(255), "price" varchar(255), "quantity" varchar(255), "sku" varchar(255), "created_at" datetime, "updated_at" datetime) 
+ SQL (0.1ms) INSERT INTO schema_migrations (version) VALUES ('20100723005631')
+ SQL (0.3ms)  SELECT name
+ FROM sqlite_master
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
+
+ SQL (0.1ms) SELECT version FROM schema_migrations
+ SQL (0.2ms)  SELECT name
+ FROM sqlite_master
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
+
+ SQL (0.0ms) PRAGMA index_list("products")
+
+
+Processing ProductsController#index (for 127.0.0.1 at 2010-07-22 17:56:51) [GET]
+ Product Load (0.4ms) SELECT * FROM "products" 
+Rendering template within layouts/products
+Rendering products/index
+Completed in 23ms (View: 19, DB: 0) | 200 OK [http://localhost/products]
+
+
+Processing ProductsController#index to json (for 127.0.0.1 at 2010-07-22 17:57:01) [GET]
+ Product Load (0.4ms) SELECT * FROM "products" 
+Completed in 5ms (View: 1, DB: 0) | 406 Not Acceptable [http://localhost/products.json]
+
+
+Processing ProductsController#new (for 127.0.0.1 at 2010-07-22 17:57:09) [GET]
+Rendering template within layouts/products
+Rendering products/new
+Completed in 19ms (View: 14, DB: 0) | 200 OK [http://localhost/products/new]
+
+
+Processing ProductsController#create (for 127.0.0.1 at 2010-07-22 17:57:23) [POST]
+ Parameters: {"commit"=>"Create", "authenticity_token"=>"Q/IDTP2cWx18cqQwkJXD+TEwHsswR9QFKuRCbA2tZFg=", "product"=>{"price"=>"$199.99", "brand"=>"Apple", "name"=>"iPhone", "quantity"=>"2", "sku"=>"12345"}}
+ Product Create (0.4ms) INSERT INTO "products" ("name", "brand", "price", "created_at", "quantity", "updated_at", "sku") VALUES('iPhone', 'Apple', '$199.99', '2010-07-23 00:57:23', '2', '2010-07-23 00:57:23', '12345')
+Redirected to http://localhost:3000/products/1
+Completed in 10ms (DB: 0) | 302 Found [http://localhost/products]
+
+
+Processing ProductsController#show (for 127.0.0.1 at 2010-07-22 17:57:23) [GET]
+ Parameters: {"id"=>"1"}
+ Product Load (0.2ms) SELECT * FROM "products" WHERE ("products"."id" = 1) 
+Rendering template within layouts/products
+Rendering products/show
+Completed in 11ms (View: 6, DB: 0) | 200 OK [http://localhost/products/1]
+
+
+Processing ProductsController#show to json (for 127.0.0.1 at 2010-07-22 17:57:25) [GET]
+ Parameters: {"id"=>"1"}
+ Product Load (0.2ms) SELECT * FROM "products" WHERE ("products"."id" = 1) 
+Completed in 75ms (View: 1, DB: 0) | 406 Not Acceptable [http://localhost/products/1.json]
+
+
+Processing ProductsController#index to json (for 127.0.0.1 at 2010-07-22 17:57:33) [GET]
+ Product Load (0.5ms) SELECT * FROM "products" 
+Completed in 5ms (View: 1, DB: 0) | 406 Not Acceptable [http://localhost/products.json]
+
+
+Processing ProductsController#index to json (for 127.0.0.1 at 2010-07-22 17:58:01) [GET]
+ Product Load (0.6ms) SELECT * FROM "products" 
+Completed in 14ms (View: 9, DB: 1) | 200 OK [http://localhost/products.json]
+
+
+Processing ProductsController#create (for 127.0.0.1 at 2010-07-22 18:16:15) [POST]
+ Parameters: {"product"=>{"price"=>"$299.99", "name"=>"iPhone", "brand"=>"Apple", "quantity"=>"5", "sku"=>"1234"}}
+
+ActionController::InvalidAuthenticityToken (ActionController::InvalidAuthenticityToken):
+
+
+Rendered rescues/_trace (31.4ms)
+Rendered rescues/_request_and_response (1.3ms)
+Rendering rescues/layout (unprocessable_entity)
+
+
+Processing ProductsController#index to json (for 127.0.0.1 at 2010-07-22 18:16:15) [GET]
+ Product Load (0.6ms) SELECT * FROM "products" 
+Completed in 8ms (View: 3, DB: 1) | 200 OK [http://localhost/products.json]
+
+
+Processing ProductsController#create (for 127.0.0.1 at 2010-07-22 18:16:16) [POST]
+ Parameters: {"product"=>{"price"=>"$299.99", "name"=>"iPhone", "brand"=>"Apple", "quantity"=>"5", "sku"=>"1234"}}
+
+ActionController::InvalidAuthenticityToken (ActionController::InvalidAuthenticityToken):
+
+
+Rendered rescues/_trace (110.0ms)
+Rendered rescues/_request_and_response (0.4ms)
+Rendering rescues/layout (unprocessable_entity)
+
+
+Processing ProductsController#create (for 127.0.0.1 at 2010-07-22 18:16:16) [POST]
+ Parameters: {"product"=>{"price"=>"$299.99", "name"=>"iPhone", "brand"=>"Apple", "quantity"=>"5", "sku"=>"1234"}}
+
+ActionController::InvalidAuthenticityToken (ActionController::InvalidAuthenticityToken):
+
+
+Rendered rescues/_trace (34.5ms)
+Rendered rescues/_request_and_response (0.4ms)
+Rendering rescues/layout (unprocessable_entity)
+
+
+Processing ProductsController#create (for 127.0.0.1 at 2010-07-22 18:16:16) [POST]
+ Parameters: {"product"=>{"price"=>"$299.99", "name"=>"iPhone", "brand"=>"Apple", "quantity"=>"5", "sku"=>"1234"}}
+
+ActionController::InvalidAuthenticityToken (ActionController::InvalidAuthenticityToken):
+
+
+Rendered rescues/_trace (33.4ms)
+Rendered rescues/_request_and_response (0.4ms)
+Rendering rescues/layout (unprocessable_entity)
+
+
+Processing ProductsController#create (for 127.0.0.1 at 2010-07-22 18:17:34) [POST]
+ Parameters: {"product"=>{"price"=>"$299.99", "name"=>"iPhone", "brand"=>"Apple", "quantity"=>"5", "sku"=>"1234"}}
+
+ActionController::InvalidAuthenticityToken (ActionController::InvalidAuthenticityToken):
+
+
+Rendered rescues/_trace (110.2ms)
+Rendered rescues/_request_and_response (0.4ms)
+Rendering rescues/layout (unprocessable_entity)
+
+
+Processing ProductsController#index to json (for 127.0.0.1 at 2010-07-22 18:17:34) [GET]
+ Product Load (0.5ms) SELECT * FROM "products" 
+Completed in 8ms (View: 3, DB: 0) | 200 OK [http://localhost/products.json]
+
+
+Processing ProductsController#create (for 127.0.0.1 at 2010-07-22 18:17:34) [POST]
+ Parameters: {"product"=>{"price"=>"$299.99", "name"=>"iPhone", "brand"=>"Apple", "quantity"=>"5", "sku"=>"1234"}}
+
+ActionController::InvalidAuthenticityToken (ActionController::InvalidAuthenticityToken):
+
+
+Rendered rescues/_trace (30.2ms)
+Rendered rescues/_request_and_response (0.4ms)
+Rendering rescues/layout (unprocessable_entity)
+
+
+Processing ProductsController#create (for 127.0.0.1 at 2010-07-22 18:17:34) [POST]
+ Parameters: {"product"=>{"price"=>"$299.99", "name"=>"iPhone", "brand"=>"Apple", "quantity"=>"5", "sku"=>"1234"}}
+
+ActionController::InvalidAuthenticityToken (ActionController::InvalidAuthenticityToken):
+
+
+Rendered rescues/_trace (112.4ms)
+Rendered rescues/_request_and_response (0.4ms)
+Rendering rescues/layout (unprocessable_entity)
+
+
+Processing ProductsController#create (for 127.0.0.1 at 2010-07-22 18:17:35) [POST]
+ Parameters: {"product"=>{"price"=>"$299.99", "name"=>"iPhone", "brand"=>"Apple", "quantity"=>"5", "sku"=>"1234"}}
+
+ActionController::InvalidAuthenticityToken (ActionController::InvalidAuthenticityToken):
+
+
+Rendered rescues/_trace (32.6ms)
+Rendered rescues/_request_and_response (0.4ms)
+Rendering rescues/layout (unprocessable_entity)
+
+
+Processing ApplicationController#create (for 127.0.0.1 at 2010-07-22 18:18:32) [POST]
+ Parameters: {"product"=>{"price"=>"$299.99", "name"=>"iPhone", "brand"=>"Apple", "quantity"=>"5", "sku"=>"1234"}}
+
+SyntaxError (/Users/lars/Dev/code/rhomobile/webinar-samples/store-rails/app/controllers/products_controller.rb:3: syntax error, unexpected ',', expecting tASSOC
+ protect_from_forgery :except => :create, :update, :delete
+ ^):
+
+
+Rendered rescues/_trace (27.0ms)
+Rendered rescues/_request_and_response (1.2ms)
+Rendering rescues/layout (internal_server_error)
+
+
+Processing ApplicationController#index to json (for 127.0.0.1 at 2010-07-22 18:18:32) [GET]
+
+SyntaxError (/Users/lars/Dev/code/rhomobile/webinar-samples/store-rails/app/controllers/products_controller.rb:3: syntax error, unexpected ',', expecting tASSOC
+ protect_from_forgery :except => :create, :update, :delete
+ ^):
+
+
+Rendered rescues/_trace (30.4ms)
+Rendered rescues/_request_and_response (0.4ms)
+Rendering rescues/layout (internal_server_error)
+
+
+Processing ApplicationController#create (for 127.0.0.1 at 2010-07-22 18:18:32) [POST]
+ Parameters: {"product"=>{"price"=>"$299.99", "name"=>"iPhone", "brand"=>"Apple", "quantity"=>"5", "sku"=>"1234"}}
+
+SyntaxError (/Users/lars/Dev/code/rhomobile/webinar-samples/store-rails/app/controllers/products_controller.rb:3: syntax error, unexpected ',', expecting tASSOC
+ protect_from_forgery :except => :create, :update, :delete
+ ^):
+
+
+Rendered rescues/_trace (103.6ms)
+Rendered rescues/_request_and_response (0.3ms)
+Rendering rescues/layout (internal_server_error)
+
+
+Processing ApplicationController#create (for 127.0.0.1 at 2010-07-22 18:18:32) [POST]
+ Parameters: {"product"=>{"price"=>"$299.99", "name"=>"iPhone", "brand"=>"Apple", "quantity"=>"5", "sku"=>"1234"}}
+
+SyntaxError (/Users/lars/Dev/code/rhomobile/webinar-samples/store-rails/app/controllers/products_controller.rb:3: syntax error, unexpected ',', expecting tASSOC
+ protect_from_forgery :except => :create, :update, :delete
+ ^):
+
+
+Rendered rescues/_trace (26.8ms)
+Rendered rescues/_request_and_response (0.4ms)
+Rendering rescues/layout (internal_server_error)
+
+
+Processing ApplicationController#create (for 127.0.0.1 at 2010-07-22 18:18:33) [POST]
+ Parameters: {"product"=>{"price"=>"$299.99", "name"=>"iPhone", "brand"=>"Apple", "quantity"=>"5", "sku"=>"1234"}}
+
+SyntaxError (/Users/lars/Dev/code/rhomobile/webinar-samples/store-rails/app/controllers/products_controller.rb:3: syntax error, unexpected ',', expecting tASSOC
+ protect_from_forgery :except => :create, :update, :delete
+ ^):
+
+
+Rendered rescues/_trace (27.5ms)
+Rendered rescues/_request_and_response (0.3ms)
+Rendering rescues/layout (internal_server_error)
+
+
+Processing ProductsController#create (for 127.0.0.1 at 2010-07-22 18:19:04) [POST]
+ Parameters: {"product"=>{"price"=>"$299.99", "name"=>"iPhone", "brand"=>"Apple", "quantity"=>"5", "sku"=>"1234"}}
+ Product Create (0.5ms) INSERT INTO "products" ("name", "brand", "price", "created_at", "quantity", "updated_at", "sku") VALUES('iPhone', 'Apple', '$299.99', '2010-07-23 01:19:04', '5', '2010-07-23 01:19:04', '1234')
+Completed in 128ms (View: 116, DB: 0) | 201 Created [http://localhost/products]
+
+
+Processing ProductsController#show to json (for 127.0.0.1 at 2010-07-22 18:19:04) [GET]
+ Parameters: {"id"=>"2"}
+ Product Load (0.2ms) SELECT * FROM "products" WHERE ("products"."id" = 2) 
+Completed in 6ms (View: 1, DB: 0) | 406 Not Acceptable [http://localhost/products/2.json]
+
+
+Processing ProductsController#index to json (for 127.0.0.1 at 2010-07-22 18:19:04) [GET]
+ Product Load (0.6ms) SELECT * FROM "products" 
+Completed in 8ms (View: 4, DB: 1) | 200 OK [http://localhost/products.json]
+
+
+Processing ProductsController#create (for 127.0.0.1 at 2010-07-22 18:19:04) [POST]
+ Parameters: {"product"=>{"price"=>"$299.99", "name"=>"iPhone", "brand"=>"Apple", "quantity"=>"5", "sku"=>"1234"}}
+ Product Create (0.4ms) INSERT INTO "products" ("name", "brand", "price", "created_at", "quantity", "updated_at", "sku") VALUES('iPhone', 'Apple', '$299.99', '2010-07-23 01:19:04', '5', '2010-07-23 01:19:04', '1234')
+Completed in 12ms (View: 2, DB: 0) | 201 Created [http://localhost/products]
+
+
+Processing ProductsController#show to json (for 127.0.0.1 at 2010-07-22 18:19:04) [GET]
+ Parameters: {"id"=>"3"}
+ Product Load (0.2ms) SELECT * FROM "products" WHERE ("products"."id" = 3) 
+Completed in 6ms (View: 1, DB: 0) | 406 Not Acceptable [http://localhost/products/3.json]
+
+
+Processing ProductsController#create (for 127.0.0.1 at 2010-07-22 18:19:04) [POST]
+ Parameters: {"product"=>{"price"=>"$299.99", "name"=>"iPhone", "brand"=>"Apple", "quantity"=>"5", "sku"=>"1234"}}
+ Product Create (0.5ms) INSERT INTO "products" ("name", "brand", "price", "created_at", "quantity", "updated_at", "sku") VALUES('iPhone', 'Apple', '$299.99', '2010-07-23 01:19:04', '5', '2010-07-23 01:19:04', '1234')
+Completed in 15ms (View: 2, DB: 0) | 201 Created [http://localhost/products]
+
+
+Processing ProductsController#show to json (for 127.0.0.1 at 2010-07-22 18:19:04) [GET]
+ Parameters: {"id"=>"4"}
+ Product Load (0.3ms) SELECT * FROM "products" WHERE ("products"."id" = 4) 
+Completed in 6ms (View: 1, DB: 0) | 406 Not Acceptable [http://localhost/products/4.json]
+
+
+Processing ProductsController#create (for 127.0.0.1 at 2010-07-22 18:19:04) [POST]
+ Parameters: {"product"=>{"price"=>"$299.99", "name"=>"iPhone", "brand"=>"Apple", "quantity"=>"5", "sku"=>"1234"}}
+ Product Create (0.4ms) INSERT INTO "products" ("name", "brand", "price", "created_at", "quantity", "updated_at", "sku") VALUES('iPhone', 'Apple', '$299.99', '2010-07-23 01:19:05', '5', '2010-07-23 01:19:05', '1234')
+Completed in 88ms (View: 2, DB: 0) | 201 Created [http://localhost/products]
+
+
+Processing ProductsController#show to json (for 127.0.0.1 at 2010-07-22 18:19:05) [GET]
+ Parameters: {"id"=>"5"}
+ Product Load (0.2ms) SELECT * FROM "products" WHERE ("products"."id" = 5) 
+Completed in 6ms (View: 1, DB: 0) | 406 Not Acceptable [http://localhost/products/5.json]
+
+
+Processing ProductsController#index to json (for 127.0.0.1 at 2010-07-22 18:19:29) [GET]
+ Product Load (0.8ms) SELECT * FROM "products" 
+Completed in 10ms (View: 5, DB: 1) | 200 OK [http://localhost/products.json]
+
+
+Processing ProductsController#index (for 127.0.0.1 at 2010-07-22 18:19:36) [GET]
+ Product Load (0.8ms) SELECT * FROM "products" 
+Rendering template within layouts/products
+Rendering products/index
+Completed in 35ms (View: 28, DB: 1) | 200 OK [http://localhost/products]
+
+
+Processing ProductsController#destroy (for 127.0.0.1 at 2010-07-22 18:19:39) [DELETE]
+ Parameters: {"authenticity_token"=>"Q/IDTP2cWx18cqQwkJXD+TEwHsswR9QFKuRCbA2tZFg=", "id"=>"2"}
+ Product Load (0.4ms) SELECT * FROM "products" WHERE ("products"."id" = 2) 
+ Product Destroy (0.3ms) DELETE FROM "products" WHERE "id" = 2
+Redirected to http://localhost:3000/products
+Completed in 14ms (DB: 1) | 302 Found [http://localhost/products/2]
+
+
+Processing ProductsController#index (for 127.0.0.1 at 2010-07-22 18:19:39) [GET]
+ Product Load (0.8ms) SELECT * FROM "products" 
+Rendering template within layouts/products
+Rendering products/index
+Completed in 18ms (View: 13, DB: 1) | 200 OK [http://localhost/products]
+
+
+Processing ProductsController#destroy (for 127.0.0.1 at 2010-07-22 18:19:40) [DELETE]
+ Parameters: {"authenticity_token"=>"Q/IDTP2cWx18cqQwkJXD+TEwHsswR9QFKuRCbA2tZFg=", "id"=>"3"}
+ Product Load (0.2ms) SELECT * FROM "products" WHERE ("products"."id" = 3) 
+ Product Destroy (0.3ms) DELETE FROM "products" WHERE "id" = 3
+Redirected to http://localhost:3000/products
+Completed in 11ms (DB: 0) | 302 Found [http://localhost/products/3]
+
+
+Processing ProductsController#index (for 127.0.0.1 at 2010-07-22 18:19:40) [GET]
+ Product Load (0.6ms) SELECT * FROM "products" 
+Rendering template within layouts/products
+Rendering products/index
+Completed in 96ms (View: 91, DB: 1) | 200 OK [http://localhost/products]
+
+
+Processing ProductsController#destroy (for 127.0.0.1 at 2010-07-22 18:19:41) [DELETE]
+ Parameters: {"authenticity_token"=>"Q/IDTP2cWx18cqQwkJXD+TEwHsswR9QFKuRCbA2tZFg=", "id"=>"4"}
+ Product Load (0.3ms) SELECT * FROM "products" WHERE ("products"."id" = 4) 
+ Product Destroy (0.4ms) DELETE FROM "products" WHERE "id" = 4
+Redirected to http://localhost:3000/products
+Completed in 11ms (DB: 1) | 302 Found [http://localhost/products/4]
+
+
+Processing ProductsController#index (for 127.0.0.1 at 2010-07-22 18:19:41) [GET]
+ Product Load (0.6ms) SELECT * FROM "products" 
+Rendering template within layouts/products
+Rendering products/index
+Completed in 13ms (View: 8, DB: 1) | 200 OK [http://localhost/products]
+
+
+Processing ProductsController#destroy (for 127.0.0.1 at 2010-07-22 18:19:41) [DELETE]
+ Parameters: {"authenticity_token"=>"Q/IDTP2cWx18cqQwkJXD+TEwHsswR9QFKuRCbA2tZFg=", "id"=>"5"}
+ Product Load (0.2ms) SELECT * FROM "products" WHERE ("products"."id" = 5) 
+ Product Destroy (0.4ms) DELETE FROM "products" WHERE "id" = 5
+Redirected to http://localhost:3000/products
+Completed in 10ms (DB: 1) | 302 Found [http://localhost/products/5]
+
+
+Processing ProductsController#index (for 127.0.0.1 at 2010-07-22 18:19:41) [GET]
+ Product Load (0.6ms) SELECT * FROM "products" 
+Rendering template within layouts/products
+Rendering products/index
+Completed in 11ms (View: 6, DB: 1) | 200 OK [http://localhost/products]
+
+
+Processing ProductsController#create (for 127.0.0.1 at 2010-07-22 18:20:30) [POST]
+ Parameters: {"product"=>{"price"=>"$299.99", "name"=>"iPhone", "brand"=>"Apple", "quantity"=>"5", "sku"=>"1234"}}
+ Product Create (0.4ms) INSERT INTO "products" ("name", "brand", "price", "created_at", "quantity", "updated_at", "sku") VALUES('iPhone', 'Apple', '$299.99', '2010-07-23 01:20:30', '5', '2010-07-23 01:20:30', '1234')
+Completed in 21ms (View: 9, DB: 0) | 201 Created [http://localhost/products]
+
+
+Processing ProductsController#show to json (for 127.0.0.1 at 2010-07-22 18:20:30) [GET]
+ Parameters: {"id"=>"6"}
+ Product Load (0.2ms) SELECT * FROM "products" WHERE ("products"."id" = 6) 
+Completed in 8ms (View: 3, DB: 0) | 200 OK [http://localhost/products/6.json]
+
+
+Processing ProductsController#index to json (for 127.0.0.1 at 2010-07-22 18:20:30) [GET]
+ Product Load (0.6ms) SELECT * FROM "products" 
+Completed in 9ms (View: 4, DB: 1) | 200 OK [http://localhost/products.json]
+
+
+Processing ProductsController#create (for 127.0.0.1 at 2010-07-22 18:20:30) [POST]
+ Parameters: {"product"=>{"price"=>"$299.99", "name"=>"iPhone", "brand"=>"Apple", "quantity"=>"5", "sku"=>"1234"}}
+ Product Create (0.4ms) INSERT INTO "products" ("name", "brand", "price", "created_at", "quantity", "updated_at", "sku") VALUES('iPhone', 'Apple', '$299.99', '2010-07-23 01:20:30', '5', '2010-07-23 01:20:30', '1234')
+Completed in 13ms (View: 2, DB: 0) | 201 Created [http://localhost/products]
+
+
+Processing ProductsController#show to json (for 127.0.0.1 at 2010-07-22 18:20:30) [GET]
+ Parameters: {"id"=>"7"}
+ Product Load (0.2ms) SELECT * FROM "products" WHERE ("products"."id" = 7) 
+Completed in 8ms (View: 3, DB: 0) | 200 OK [http://localhost/products/7.json]
+
+
+Processing ProductsController#create (for 127.0.0.1 at 2010-07-22 18:20:30) [POST]
+ Parameters: {"product"=>{"price"=>"$299.99", "name"=>"iPhone", "brand"=>"Apple", "quantity"=>"5", "sku"=>"1234"}}
+ Product Create (0.6ms) INSERT INTO "products" ("name", "brand", "price", "created_at", "quantity", "updated_at", "sku") VALUES('iPhone', 'Apple', '$299.99', '2010-07-23 01:20:30', '5', '2010-07-23 01:20:30', '1234')
+Completed in 15ms (View: 2, DB: 1) | 201 Created [http://localhost/products]
+
+
+Processing ProductsController#show to json (for 127.0.0.1 at 2010-07-22 18:20:30) [GET]
+ Parameters: {"id"=>"8"}
+ Product Load (0.2ms) SELECT * FROM "products" WHERE ("products"."id" = 8) 
+Completed in 8ms (View: 2, DB: 0) | 200 OK [http://localhost/products/8.json]
+
+
+Processing ProductsController#update (for 127.0.0.1 at 2010-07-22 18:20:30) [PUT]
+ Parameters: {"id"=>"8", "product"=>{"price"=>"$199.99"}}
+ Product Load (0.2ms) SELECT * FROM "products" WHERE ("products"."id" = 8) 
+ Product Update (0.3ms) UPDATE "products" SET "updated_at" = '2010-07-23 01:20:30', "price" = '$199.99' WHERE "id" = 8
+Completed in 10ms (View: 1, DB: 1) | 200 OK [http://localhost/products/8]
+
+
+Processing ProductsController#index to json (for 127.0.0.1 at 2010-07-22 18:20:30) [GET]
+ Product Load (0.7ms) SELECT * FROM "products" 
+Completed in 10ms (View: 5, DB: 1) | 200 OK [http://localhost/products.json]
+
+
+Processing ProductsController#create (for 127.0.0.1 at 2010-07-22 18:20:30) [POST]
+ Parameters: {"product"=>{"price"=>"$299.99", "name"=>"iPhone", "brand"=>"Apple", "quantity"=>"5", "sku"=>"1234"}}
+ Product Create (0.4ms) INSERT INTO "products" ("name", "brand", "price", "created_at", "quantity", "updated_at", "sku") VALUES('iPhone', 'Apple', '$299.99', '2010-07-23 01:20:30', '5', '2010-07-23 01:20:30', '1234')
+Completed in 14ms (View: 2, DB: 0) | 201 Created [http://localhost/products]
+
+
+Processing ProductsController#show to json (for 127.0.0.1 at 2010-07-22 18:20:30) [GET]
+ Parameters: {"id"=>"9"}
+ Product Load (0.2ms) SELECT * FROM "products" WHERE ("products"."id" = 9) 
+Completed in 8ms (View: 2, DB: 0) | 200 OK [http://localhost/products/9.json]
+
+
+Processing ProductsController#destroy (for 127.0.0.1 at 2010-07-22 18:20:30) [DELETE]
+ Parameters: {"id"=>"9"}
+ Product Load (0.2ms) SELECT * FROM "products" WHERE ("products"."id" = 9) 
+ Product Destroy (0.3ms) DELETE FROM "products" WHERE "id" = 9
+Completed in 9ms (View: 1, DB: 0) | 200 OK [http://localhost/products/9]
+
+
+Processing ProductsController#index to json (for 127.0.0.1 at 2010-07-22 18:27:56) [GET]
+ Product Load (0.7ms) SELECT * FROM "products" 
+Completed in 9ms (View: 5, DB: 1) | 200 OK [http://localhost/products.json]
+
+
+Processing ProductsController#index (for 127.0.0.1 at 2010-07-22 18:28:34) [GET]
+ Product Load (0.7ms) SELECT * FROM "products" 
+Rendering template within layouts/products
+Rendering products/index
+Completed in 25ms (View: 20, DB: 1) | 200 OK [http://localhost/products]
+
+
+Processing ProductsController#destroy (for 127.0.0.1 at 2010-07-22 18:28:37) [DELETE]
+ Parameters: {"authenticity_token"=>"Q/IDTP2cWx18cqQwkJXD+TEwHsswR9QFKuRCbA2tZFg=", "id"=>"6"}
+ Product Load (0.3ms) SELECT * FROM "products" WHERE ("products"."id" = 6) 
+ Product Destroy (0.3ms) DELETE FROM "products" WHERE "id" = 6
+Redirected to http://localhost:3000/products
+Completed in 91ms (DB: 1) | 302 Found [http://localhost/products/6]
+
+
+Processing ProductsController#index (for 127.0.0.1 at 2010-07-22 18:28:38) [GET]
+ Product Load (0.6ms) SELECT * FROM "products" 
+Rendering template within layouts/products
+Rendering products/index
+Completed in 15ms (View: 11, DB: 1) | 200 OK [http://localhost/products]
+
+
+Processing ProductsController#destroy (for 127.0.0.1 at 2010-07-22 18:28:38) [DELETE]
+ Parameters: {"authenticity_token"=>"Q/IDTP2cWx18cqQwkJXD+TEwHsswR9QFKuRCbA2tZFg=", "id"=>"7"}
+ Product Load (0.3ms) SELECT * FROM "products" WHERE ("products"."id" = 7) 
+ Product Destroy (0.3ms) DELETE FROM "products" WHERE "id" = 7
+Redirected to http://localhost:3000/products
+Completed in 10ms (DB: 1) | 302 Found [http://localhost/products/7]
+
+
+Processing ProductsController#index (for 127.0.0.1 at 2010-07-22 18:28:38) [GET]
+ Product Load (0.6ms) SELECT * FROM "products" 
+Rendering template within layouts/products
+Rendering products/index
+Completed in 13ms (View: 8, DB: 1) | 200 OK [http://localhost/products]
+
+
+Processing ProductsController#destroy (for 127.0.0.1 at 2010-07-22 18:28:39) [DELETE]
+ Parameters: {"authenticity_token"=>"Q/IDTP2cWx18cqQwkJXD+TEwHsswR9QFKuRCbA2tZFg=", "id"=>"8"}
+ Product Load (0.2ms) SELECT * FROM "products" WHERE ("products"."id" = 8) 
+ Product Destroy (0.3ms) DELETE FROM "products" WHERE "id" = 8
+Redirected to http://localhost:3000/products
+Completed in 10ms (DB: 0) | 302 Found [http://localhost/products/8]
+
+
+Processing ProductsController#index (for 127.0.0.1 at 2010-07-22 18:28:39) [GET]
+ Product Load (0.5ms) SELECT * FROM "products" 
+Rendering template within layouts/products
+Rendering products/index
+Completed in 11ms (View: 6, DB: 0) | 200 OK [http://localhost/products]
+
+
+Processing ProductsController#index to json (for 127.0.0.1 at 2010-07-22 18:35:14) [GET]
+ Product Load (0.5ms) SELECT * FROM "products" 
+Completed in 8ms (View: 4, DB: 1) | 200 OK [http://localhost/products.json]
+
+
+Processing ProductsController#index to json (for 127.0.0.1 at 2010-07-22 18:40:15) [GET]
+ Product Load (0.5ms) SELECT * FROM "products" 
+Completed in 8ms (View: 3, DB: 0) | 200 OK [http://localhost/products.json]
+
+
+Processing ProductsController#index to json (for 127.0.0.1 at 2010-07-22 18:45:15) [GET]
+ Product Load (0.5ms) SELECT * FROM "products" 
+Completed in 8ms (View: 3, DB: 0) | 200 OK [http://localhost/products.json]
+
+
+Processing ProductsController#index (for 127.0.0.1 at 2010-07-22 18:50:20) [GET]
+ Product Load (0.6ms) SELECT * FROM "products" 
+Rendering template within layouts/products
+Rendering products/index
+Completed in 291ms (View: 89, DB: 1) | 200 OK [http://localhost/products]
+
+
+Processing ProductsController#new (for 127.0.0.1 at 2010-07-22 18:50:22) [GET]
+Rendering template within layouts/products
+Rendering products/new
+Completed in 20ms (View: 13, DB: 0) | 200 OK [http://localhost/products/new]
+
+
+Processing ProductsController#create (for 127.0.0.1 at 2010-07-22 18:50:26) [POST]
+ Parameters: {"commit"=>"Create", "authenticity_token"=>"Q/IDTP2cWx18cqQwkJXD+TEwHsswR9QFKuRCbA2tZFg=", "product"=>{"price"=>"", "brand"=>"bar", "name"=>"foo", "quantity"=>"", "sku"=>""}}
+ Product Create (0.5ms) INSERT INTO "products" ("name", "brand", "price", "created_at", "quantity", "updated_at", "sku") VALUES('foo', 'bar', '', '2010-07-23 01:50:26', '', '2010-07-23 01:50:26', '')
+
+NoMethodError (undefined method `to_hash' for #<Product:0x1034471f0>):
+ app/models/product.rb:7:in `push_rhosync_create'
+ app/controllers/products_controller.rb:50:in `create'
+ app/controllers/products_controller.rb:49:in `create'
+
+Rendered rescues/_trace (44.7ms)
+Rendered rescues/_request_and_response (1.3ms)
+Rendering rescues/layout (internal_server_error)
+
+
+Processing ProductsController#index (for 127.0.0.1 at 2010-07-22 18:51:10) [GET]
+ Product Load (0.5ms) SELECT * FROM "products" 
+Rendering template within layouts/products
+Rendering products/index
+Completed in 234ms (View: 90, DB: 1) | 200 OK [http://localhost/products]
+
+
+Processing ProductsController#new (for 127.0.0.1 at 2010-07-22 18:51:12) [GET]
+Rendering template within layouts/products
+Rendering products/new
+Completed in 20ms (View: 14, DB: 0) | 200 OK [http://localhost/products/new]
+
+
+Processing ProductsController#create (for 127.0.0.1 at 2010-07-22 18:51:14) [POST]
+ Parameters: {"commit"=>"Create", "authenticity_token"=>"Q/IDTP2cWx18cqQwkJXD+TEwHsswR9QFKuRCbA2tZFg=", "product"=>{"price"=>"", "brand"=>"bar", "name"=>"foo", "quantity"=>"", "sku"=>""}}
+ Product Create (0.4ms) INSERT INTO "products" ("name", "brand", "price", "created_at", "quantity", "updated_at", "sku") VALUES('foo', 'bar', '', '2010-07-23 01:51:14', '', '2010-07-23 01:51:14', '')
+Redirected to http://localhost:3000/products/10
+Completed in 14ms (DB: 0) | 302 Found [http://localhost/products]
+
+
+Processing ProductsController#show (for 127.0.0.1 at 2010-07-22 18:51:14) [GET]
+ Parameters: {"id"=>"10"}
+ Product Load (0.3ms) SELECT * FROM "products" WHERE ("products"."id" = 10) 
+Rendering template within layouts/products
+Rendering products/show
+Completed in 14ms (View: 6, DB: 0) | 200 OK [http://localhost/products/10]
+
+
+Processing ProductsController#index (for 127.0.0.1 at 2010-07-22 18:52:36) [GET]
+
+SyntaxError (/Users/lars/Dev/code/rhomobile/webinar-samples/store-rails/app/models/product.rb:9: odd number list for Hash):
+ app/controllers/products_controller.rb:7:in `index'
+
+Rendered rescues/_trace (34.7ms)
+Rendered rescues/_request_and_response (1.2ms)
+Rendering rescues/layout (internal_server_error)
+
+
+Processing ProductsController#index (for 127.0.0.1 at 2010-07-22 18:52:41) [GET]
+
+SyntaxError (/Users/lars/Dev/code/rhomobile/webinar-samples/store-rails/app/models/product.rb:9: odd number list for Hash):
+ app/controllers/products_controller.rb:7:in `index'
+
+Rendered rescues/_trace (36.3ms)
+Rendered rescues/_request_and_response (74.9ms)
+Rendering rescues/layout (internal_server_error)
+
+
+Processing ProductsController#index to json (for 127.0.0.1 at 2010-07-22 18:55:15) [GET]
+ Product Load (0.6ms) SELECT * FROM "products" 
+Completed in 148ms (View: 9, DB: 1) | 200 OK [http://localhost/products.json]
+
+
+Processing ProductsController#index (for 127.0.0.1 at 2010-07-22 18:57:01) [GET]
+ Product Load (0.6ms) SELECT * FROM "products" 
+Rendering template within layouts/products
+Rendering products/index
+Completed in 232ms (View: 90, DB: 1) | 200 OK [http://localhost/products]
+
+
+Processing ProductsController#destroy (for 127.0.0.1 at 2010-07-22 18:57:04) [DELETE]
+ Parameters: {"authenticity_token"=>"Q/IDTP2cWx18cqQwkJXD+TEwHsswR9QFKuRCbA2tZFg=", "id"=>"10"}
+ Product Load (0.3ms) SELECT * FROM "products" WHERE ("products"."id" = 10) 
+ Product Destroy (0.5ms) DELETE FROM "products" WHERE "id" = 10
+Redirected to http://localhost:3000/products
+Completed in 15ms (DB: 1) | 302 Found [http://localhost/products/10]
+
+
+Processing ProductsController#index (for 127.0.0.1 at 2010-07-22 18:57:04) [GET]
+ Product Load (0.5ms) SELECT * FROM "products" 
+Rendering template within layouts/products
+Rendering products/index
+Completed in 13ms (View: 6, DB: 1) | 200 OK [http://localhost/products]
+
+
+Processing ProductsController#new (for 127.0.0.1 at 2010-07-22 18:57:04) [GET]
+Rendering template within layouts/products
+Rendering products/new
+Completed in 20ms (View: 13, DB: 0) | 200 OK [http://localhost/products/new]
+
+
+Processing ProductsController#create (for 127.0.0.1 at 2010-07-22 18:57:07) [POST]
+ Parameters: {"commit"=>"Create", "authenticity_token"=>"Q/IDTP2cWx18cqQwkJXD+TEwHsswR9QFKuRCbA2tZFg=", "product"=>{"price"=>"", "brand"=>"bar", "name"=>"foo", "quantity"=>"", "sku"=>""}}
+ Product Create (371.4ms) INSERT INTO "products" ("name", "brand", "price", "created_at", "quantity", "updated_at", "sku") VALUES('foo', 'bar', '', '2010-07-23 01:57:07', '', '2010-07-23 01:57:07', '')
+
+NoMethodError (You have a nil object when you didn't expect it!
+You might have expected an instance of Array.
+The error occurred while evaluating nil.+):
+ /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:1112:in `addr_port'
+ /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:1072:in `begin_transport'
+ /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:1047:in `__request__'
+ /Library/Ruby/Gems/1.8/gems/rest-client-1.6.0/lib/restclient/net_http_ext.rb:15:in `request'
+ /Library/Ruby/Gems/1.8/gems/rest-client-1.6.0/lib/restclient/request.rb:167:in `transmit'
+ /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:543:in `start'
+ /Library/Ruby/Gems/1.8/gems/rest-client-1.6.0/lib/restclient/request.rb:166:in `transmit'
+ /Library/Ruby/Gems/1.8/gems/rest-client-1.6.0/lib/restclient/request.rb:60:in `execute'
+ /Library/Ruby/Gems/1.8/gems/rest-client-1.6.0/lib/restclient/request.rb:31:in `execute'
+ /Library/Ruby/Gems/1.8/gems/rest-client-1.6.0/lib/restclient.rb:72:in `post'
+ app/models/product.rb:12:in `push_rhosync_create'
+ app/controllers/products_controller.rb:50:in `create'
+ app/controllers/products_controller.rb:49:in `create'
+
+Rendered rescues/_trace (128.4ms)
+Rendered rescues/_request_and_response (1.2ms)
+Rendering rescues/layout (internal_server_error)
+
+
+Processing ProductsController#create (for 127.0.0.1 at 2010-07-22 18:57:50) [POST]
+ Parameters: {"commit"=>"Create", "authenticity_token"=>"Q/IDTP2cWx18cqQwkJXD+TEwHsswR9QFKuRCbA2tZFg=", "product"=>{"price"=>"", "brand"=>"bar", "name"=>"foo", "quantity"=>"", "sku"=>""}}
+ Product Create (0.4ms) INSERT INTO "products" ("name", "brand", "price", "created_at", "quantity", "updated_at", "sku") VALUES('foo', 'bar', '', '2010-07-23 01:57:50', '', '2010-07-23 01:57:50', '')
+
+NoMethodError (You have a nil object when you didn't expect it!
+You might have expected an instance of Array.
+The error occurred while evaluating nil.+):
+ /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:1112:in `addr_port'
+ /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:1072:in `begin_transport'
+ /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:1047:in `__request__'
+ /Library/Ruby/Gems/1.8/gems/rest-client-1.6.0/lib/restclient/net_http_ext.rb:15:in `request'
+ /Library/Ruby/Gems/1.8/gems/rest-client-1.6.0/lib/restclient/request.rb:167:in `transmit'
+ /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:543:in `start'
+ /Library/Ruby/Gems/1.8/gems/rest-client-1.6.0/lib/restclient/request.rb:166:in `transmit'
+ /Library/Ruby/Gems/1.8/gems/rest-client-1.6.0/lib/restclient/request.rb:60:in `execute'
+ /Library/Ruby/Gems/1.8/gems/rest-client-1.6.0/lib/restclient/request.rb:31:in `execute'
+ /Library/Ruby/Gems/1.8/gems/rest-client-1.6.0/lib/restclient.rb:72:in `post'
+ app/models/product.rb:12:in `push_rhosync_create'
+ app/controllers/products_controller.rb:50:in `create'
+ app/controllers/products_controller.rb:49:in `create'
+
+Rendered rescues/_trace (52.0ms)
+Rendered rescues/_request_and_response (1.3ms)
+Rendering rescues/layout (internal_server_error)
+
+
+Processing ProductsController#create (for 127.0.0.1 at 2010-07-22 18:58:10) [POST]
+ Parameters: {"commit"=>"Create", "authenticity_token"=>"Q/IDTP2cWx18cqQwkJXD+TEwHsswR9QFKuRCbA2tZFg=", "product"=>{"price"=>"", "brand"=>"bar", "name"=>"foo", "quantity"=>"", "sku"=>""}}
+ Product Create (0.4ms) INSERT INTO "products" ("name", "brand", "price", "created_at", "quantity", "updated_at", "sku") VALUES('foo', 'bar', '', '2010-07-23 01:58:11', '', '2010-07-23 01:58:11', '')
+
+NoMethodError (You have a nil object when you didn't expect it!
+You might have expected an instance of Array.
+The error occurred while evaluating nil.+):
+ /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:1112:in `addr_port'
+ /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:1072:in `begin_transport'
+ /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:1047:in `__request__'
+ /Library/Ruby/Gems/1.8/gems/rest-client-1.6.0/lib/restclient/net_http_ext.rb:15:in `request'
+ /Library/Ruby/Gems/1.8/gems/rest-client-1.6.0/lib/restclient/request.rb:167:in `transmit'
+ /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:543:in `start'
+ /Library/Ruby/Gems/1.8/gems/rest-client-1.6.0/lib/restclient/request.rb:166:in `transmit'
+ /Library/Ruby/Gems/1.8/gems/rest-client-1.6.0/lib/restclient/request.rb:60:in `execute'
+ /Library/Ruby/Gems/1.8/gems/rest-client-1.6.0/lib/restclient/request.rb:31:in `execute'
+ /Library/Ruby/Gems/1.8/gems/rest-client-1.6.0/lib/restclient.rb:72:in `post'
+ app/models/product.rb:12:in `push_rhosync_create'
+ app/controllers/products_controller.rb:50:in `create'
+ app/controllers/products_controller.rb:49:in `create'
+
+Rendered rescues/_trace (48.6ms)
+Rendered rescues/_request_and_response (1.3ms)
+Rendering rescues/layout (internal_server_error)
+
+
+Processing ProductsController#create (for 127.0.0.1 at 2010-07-22 18:59:29) [POST]
+ Parameters: {"commit"=>"Create", "authenticity_token"=>"Q/IDTP2cWx18cqQwkJXD+TEwHsswR9QFKuRCbA2tZFg=", "product"=>{"price"=>"", "brand"=>"bar", "name"=>"foo", "quantity"=>"", "sku"=>""}}
+ Product Create (0.4ms) INSERT INTO "products" ("name", "brand", "price", "created_at", "quantity", "updated_at", "sku") VALUES('foo', 'bar', '', '2010-07-23 01:59:30', '', '2010-07-23 01:59:30', '')
+
+NoMethodError (You have a nil object when you didn't expect it!
+You might have expected an instance of Array.
+The error occurred while evaluating nil.+):
+ /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:1112:in `addr_port'
+ /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:1072:in `begin_transport'
+ /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:1047:in `__request__'
+ /Library/Ruby/Gems/1.8/gems/rest-client-1.6.0/lib/restclient/net_http_ext.rb:15:in `request'
+ /Library/Ruby/Gems/1.8/gems/rest-client-1.6.0/lib/restclient/request.rb:167:in `transmit'
+ /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:543:in `start'
+ /Library/Ruby/Gems/1.8/gems/rest-client-1.6.0/lib/restclient/request.rb:166:in `transmit'
+ /Library/Ruby/Gems/1.8/gems/rest-client-1.6.0/lib/restclient/request.rb:60:in `execute'
+ /Library/Ruby/Gems/1.8/gems/rest-client-1.6.0/lib/restclient/request.rb:31:in `execute'
+ /Library/Ruby/Gems/1.8/gems/rest-client-1.6.0/lib/restclient.rb:72:in `post'
+ app/models/product.rb:12:in `push_rhosync_create'
+ app/controllers/products_controller.rb:50:in `create'
+ app/controllers/products_controller.rb:49:in `create'
+
+Rendered rescues/_trace (50.1ms)
+Rendered rescues/_request_and_response (1.3ms)
+Rendering rescues/layout (internal_server_error)
+
+
+Processing ProductsController#index to json (for 127.0.0.1 at 2010-07-22 19:00:15) [GET]
+ Product Load (0.5ms) SELECT * FROM "products" 
+Completed in 11ms (View: 6, DB: 1) | 200 OK [http://localhost/products.json]
+
+
+Processing ProductsController#index (for 127.0.0.1 at 2010-07-22 19:00:53) [GET]
+ Product Load (0.7ms) SELECT * FROM "products" 
+Rendering template within layouts/products
+Rendering products/index
+Completed in 237ms (View: 91, DB: 1) | 200 OK [http://localhost/products]
+
+
+Processing ProductsController#new (for 127.0.0.1 at 2010-07-22 19:00:55) [GET]
+Rendering template within layouts/products
+Rendering products/new
+Completed in 20ms (View: 13, DB: 0) | 200 OK [http://localhost/products/new]
+
+
+Processing ProductsController#create (for 127.0.0.1 at 2010-07-22 19:00:58) [POST]
+ Parameters: {"commit"=>"Create", "authenticity_token"=>"Q/IDTP2cWx18cqQwkJXD+TEwHsswR9QFKuRCbA2tZFg=", "product"=>{"price"=>"", "brand"=>"blah", "name"=>"blah", "quantity"=>"", "sku"=>""}}
+ Product Create (0.4ms) INSERT INTO "products" ("name", "brand", "price", "created_at", "quantity", "updated_at", "sku") VALUES('blah', 'blah', '', '2010-07-23 02:00:58', '', '2010-07-23 02:00:58', '')
+
+NoMethodError (You have a nil object when you didn't expect it!
+You might have expected an instance of Array.
+The error occurred while evaluating nil.+):
+ /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:1112:in `addr_port'
+ /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:1072:in `begin_transport'
+ /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:1047:in `__request__'
+ /Library/Ruby/Gems/1.8/gems/rest-client-1.6.0/lib/restclient/net_http_ext.rb:15:in `request'
+ /Library/Ruby/Gems/1.8/gems/rest-client-1.6.0/lib/restclient/request.rb:167:in `transmit'
+ /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:543:in `start'
+ /Library/Ruby/Gems/1.8/gems/rest-client-1.6.0/lib/restclient/request.rb:166:in `transmit'
+ /Library/Ruby/Gems/1.8/gems/rest-client-1.6.0/lib/restclient/request.rb:60:in `execute'
+ /Library/Ruby/Gems/1.8/gems/rest-client-1.6.0/lib/restclient/request.rb:31:in `execute'
+ /Library/Ruby/Gems/1.8/gems/rest-client-1.6.0/lib/restclient.rb:72:in `post'
+ app/models/product.rb:12:in `push_rhosync_create'
+ app/controllers/products_controller.rb:50:in `create'
+ app/controllers/products_controller.rb:49:in `create'
+
+Rendered rescues/_trace (55.0ms)
+Rendered rescues/_request_and_response (1.3ms)
+Rendering rescues/layout (internal_server_error)
+
+
+Processing ProductsController#create (for 127.0.0.1 at 2010-07-22 19:02:13) [POST]
+ Parameters: {"commit"=>"Create", "authenticity_token"=>"Q/IDTP2cWx18cqQwkJXD+TEwHsswR9QFKuRCbA2tZFg=", "product"=>{"price"=>"", "brand"=>"blah", "name"=>"blah", "quantity"=>"", "sku"=>""}}
+ Product Create (0.4ms) INSERT INTO "products" ("name", "brand", "price", "created_at", "quantity", "updated_at", "sku") VALUES('blah', 'blah', '', '2010-07-23 02:02:13', '', '2010-07-23 02:02:13', '')
+Redirected to http://localhost:3000/products/11
+Completed in 254ms (DB: 0) | 302 Found [http://localhost/products]
+
+
+Processing ProductsController#show (for 127.0.0.1 at 2010-07-22 19:02:13) [GET]
+ Parameters: {"id"=>"11"}
+ Product Load (0.2ms) SELECT * FROM "products" WHERE ("products"."id" = 11) 
+Rendering template within layouts/products
+Rendering products/show
+Completed in 24ms (View: 16, DB: 0) | 200 OK [http://localhost/products/11]
+
+
+Processing ProductsController#index to json (for 127.0.0.1 at 2010-07-22 19:03:11) [GET]
+ Product Load (0.8ms) SELECT * FROM "products" 
+Completed in 19ms (View: 10, DB: 1) | 200 OK [http://localhost/products.json]
+
+
+Processing ProductsController#show (for 127.0.0.1 at 2010-07-22 19:03:21) [GET]
+ Parameters: {"id"=>"11"}
+ Product Load (0.2ms) SELECT * FROM "products" WHERE ("products"."id" = 11) 
+Rendering template within layouts/products
+Rendering products/show
+Completed in 11ms (View: 3, DB: 0) | 200 OK [http://localhost/products/11]
+
+
+Processing ProductsController#index (for 127.0.0.1 at 2010-07-22 19:03:22) [GET]
+ Product Load (0.5ms) SELECT * FROM "products" 
+Rendering template within layouts/products
+Rendering products/index
+Completed in 19ms (View: 13, DB: 1) | 200 OK [http://localhost/products]
+
+
+Processing ProductsController#new (for 127.0.0.1 at 2010-07-22 19:03:23) [GET]
+Rendering template within layouts/products
+Rendering products/new
+Completed in 21ms (View: 14, DB: 0) | 200 OK [http://localhost/products/new]
+
+
+Processing ProductsController#create (for 127.0.0.1 at 2010-07-22 19:03:28) [POST]
+ Parameters: {"commit"=>"Create", "authenticity_token"=>"Q/IDTP2cWx18cqQwkJXD+TEwHsswR9QFKuRCbA2tZFg=", "product"=>{"price"=>"", "brand"=>"world", "name"=>"hello", "quantity"=>"", "sku"=>""}}
+ Product Create (0.4ms) INSERT INTO "products" ("name", "brand", "price", "created_at", "quantity", "updated_at", "sku") VALUES('hello', 'world', '', '2010-07-23 02:03:28', '', '2010-07-23 02:03:28', '')
+Redirected to http://localhost:3000/products/12
+Completed in 30ms (DB: 0) | 302 Found [http://localhost/products]
+
+
+Processing ProductsController#show (for 127.0.0.1 at 2010-07-22 19:03:28) [GET]
+ Parameters: {"id"=>"12"}
+ Product Load (0.2ms) SELECT * FROM "products" WHERE ("products"."id" = 12) 
+Rendering template within layouts/products
+Rendering products/show
+Completed in 10ms (View: 3, DB: 0) | 200 OK [http://localhost/products/12]
+
+
+Processing ProductsController#index (for 127.0.0.1 at 2010-07-22 19:03:29) [GET]
+ Product Load (0.6ms) SELECT * FROM "products" 
+Rendering template within layouts/products
+Rendering products/index
+Completed in 17ms (View: 10, DB: 1) | 200 OK [http://localhost/products]
+
+
+Processing ProductsController#destroy (for 127.0.0.1 at 2010-07-22 19:04:19) [DELETE]
+ Parameters: {"authenticity_token"=>"Q/IDTP2cWx18cqQwkJXD+TEwHsswR9QFKuRCbA2tZFg=", "id"=>"12"}
+ Product Load (0.3ms) SELECT * FROM "products" WHERE ("products"."id" = 12) 
+ Product Destroy (0.3ms) DELETE FROM "products" WHERE "id" = 12
+Redirected to http://localhost:3000/products
+Completed in 16ms (DB: 1) | 302 Found [http://localhost/products/12]
+
+
+Processing ProductsController#index (for 127.0.0.1 at 2010-07-22 19:04:19) [GET]
+ Product Load (0.6ms) SELECT * FROM "products" 
+Rendering template within layouts/products
+Rendering products/index
+Completed in 16ms (View: 9, DB: 1) | 200 OK [http://localhost/products]
+
+
+Processing ProductsController#new (for 127.0.0.1 at 2010-07-22 19:04:20) [GET]
+Rendering template within layouts/products
+Rendering products/new
+Completed in 14ms (View: 8, DB: 0) | 200 OK [http://localhost/products/new]
+
+
+Processing ProductsController#create (for 127.0.0.1 at 2010-07-22 19:04:25) [POST]
+ Parameters: {"commit"=>"Create", "authenticity_token"=>"Q/IDTP2cWx18cqQwkJXD+TEwHsswR9QFKuRCbA2tZFg=", "product"=>{"price"=>"", "brand"=>"apple", "name"=>"newproduct", "quantity"=>"", "sku"=>""}}
+ Product Create (0.4ms) INSERT INTO "products" ("name", "brand", "price", "created_at", "quantity", "updated_at", "sku") VALUES('newproduct', 'apple', '', '2010-07-23 02:04:25', '', '2010-07-23 02:04:25', '')
+Redirected to http://localhost:3000/products/13
+Completed in 24ms (DB: 0) | 302 Found [http://localhost/products]
+
+
+Processing ProductsController#show (for 127.0.0.1 at 2010-07-22 19:04:26) [GET]
+ Parameters: {"id"=>"13"}
+ Product Load (0.2ms) SELECT * FROM "products" WHERE ("products"."id" = 13) 
+Rendering template within layouts/products
+Rendering products/show
+Completed in 11ms (View: 3, DB: 0) | 200 OK [http://localhost/products/13]
+
+
+Processing ProductsController#index to json (for 127.0.0.1 at 2010-07-22 19:09:43) [GET]
+ Product Load (0.6ms) SELECT * FROM "products" 
+Completed in 11ms (View: 4, DB: 1) | 200 OK [http://localhost/products.json]
+
+
+Processing ProductsController#index to json (for 127.0.0.1 at 2010-07-22 21:51:16) [GET]
+ Product Load (0.6ms) SELECT * FROM "products" 
+Completed in 11ms (View: 4, DB: 1) | 200 OK [http://localhost/products.json]
+
+
+Processing ProductsController#index to json (for 127.0.0.1 at 2010-07-22 21:56:16) [GET]
+ Product Load (0.6ms) SELECT * FROM "products" 
+Completed in 10ms (View: 4, DB: 1) | 200 OK [http://localhost/products.json]
+
+
+Processing ProductsController#index to json (for 127.0.0.1 at 2010-07-22 22:35:13) [GET]
+
+SyntaxError (/Users/lars/Dev/code/rhomobile/webinar-samples/store-rails/app/models/product.rb:27: odd number list for Hash
+/Users/lars/Dev/code/rhomobile/webinar-samples/store-rails/app/models/product.rb:50: odd number list for Hash):
+ app/controllers/products_controller.rb:7:in `index'
+
+Rendered rescues/_trace (33.9ms)
+Rendered rescues/_request_and_response (1.2ms)
+Rendering rescues/layout (internal_server_error)
+
+
+Processing ProductsController#index to json (for 127.0.0.1 at 2010-07-22 22:36:58) [GET]
+ SQL (0.5ms)  SELECT name
+ FROM sqlite_master
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
+
+ SQL (0.2ms)  SELECT name
+ FROM sqlite_master
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
+
+
+NoMethodError (undefined method `after_delete' for #<Class:0x102dbce48>):
+ app/models/product.rb:6
+ app/controllers/products_controller.rb:7:in `index'
+
+Rendered rescues/_trace (37.2ms)
+Rendered rescues/_request_and_response (1.1ms)
+Rendering rescues/layout (internal_server_error)
+
+
+Processing ProductsController#index to json (for 127.0.0.1 at 2010-07-22 22:37:56) [GET]
+ Product Load (0.7ms) SELECT * FROM "products" 
+Completed in 229ms (View: 83, DB: 1) | 200 OK [http://localhost/products.json]
+
+
+Processing ProductsController#index (for 127.0.0.1 at 2010-07-22 22:38:29) [GET]
+ Product Load (0.7ms) SELECT * FROM "products" 
+Rendering template within layouts/products
+Rendering products/index
+Completed in 26ms (View: 19, DB: 1) | 200 OK [http://localhost/products]
+
+
+Processing ProductsController#destroy (for 127.0.0.1 at 2010-07-22 22:38:34) [DELETE]
+ Parameters: {"authenticity_token"=>"Q/IDTP2cWx18cqQwkJXD+TEwHsswR9QFKuRCbA2tZFg=", "id"=>"11"}
+ Product Load (0.2ms) SELECT * FROM "products" WHERE ("products"."id" = 11) 
+ Product Destroy (0.3ms) DELETE FROM "products" WHERE "id" = 11
+Redirected to http://localhost:3000/products
+Completed in 22ms (DB: 1) | 302 Found [http://localhost/products/11]
+
+
+Processing ProductsController#index (for 127.0.0.1 at 2010-07-22 22:38:34) [GET]
+ Product Load (0.6ms) SELECT * FROM "products" 
+Rendering template within layouts/products
+Rendering products/index
+Completed in 20ms (View: 13, DB: 1) | 200 OK [http://localhost/products]
+
+
+Processing ProductsController#edit (for 127.0.0.1 at 2010-07-22 22:46:16) [GET]
+ Parameters: {"id"=>"13"}
+ Product Load (0.2ms) SELECT * FROM "products" WHERE ("products"."id" = 13) 
+Rendering template within layouts/products
+Rendering products/edit
+Completed in 23ms (View: 16, DB: 0) | 200 OK [http://localhost/products/13/edit]
+
+
+Processing ProductsController#update (for 127.0.0.1 at 2010-07-22 22:46:26) [PUT]
+ Parameters: {"commit"=>"Update", "authenticity_token"=>"Q/IDTP2cWx18cqQwkJXD+TEwHsswR9QFKuRCbA2tZFg=", "id"=>"13", "product"=>{"price"=>"$299.99", "brand"=>"apple", "name"=>"iphone 4", "quantity"=>"", "sku"=>""}}
+ Product Load (0.2ms) SELECT * FROM "products" WHERE ("products"."id" = 13) 
+ Product Update (0.3ms) UPDATE "products" SET "updated_at" = '2010-07-23 05:46:26', "name" = 'iphone 4', "price" = '$299.99' WHERE "id" = 13
+Redirected to http://localhost:3000/products/13
+Completed in 33ms (DB: 1) | 302 Found [http://localhost/products/13]
+
+
+Processing ProductsController#show (for 127.0.0.1 at 2010-07-22 22:46:26) [GET]
+ Parameters: {"id"=>"13"}
+ Product Load (0.2ms) SELECT * FROM "products" WHERE ("products"."id" = 13) 
+Rendering template within layouts/products
+Rendering products/show
+Completed in 92ms (View: 85, DB: 0) | 200 OK [http://localhost/products/13]
View
0 rhosync-api/store-rails/log/production.log
No changes.
View
0 rhosync-api/store-rails/log/server.log
No changes.
View
0 rhosync-api/store-rails/log/test.log
No changes.
View
30 rhosync-api/store-rails/public/404.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
+ <title>The page you were looking for doesn't exist (404)</title>
+ <style type="text/css">
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
+ div.dialog {
+ width: 25em;
+ padding: 0 4em;
+ margin: 4em auto 0 auto;
+ border: 1px solid #ccc;
+ border-right-color: #999;
+ border-bottom-color: #999;
+ }
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
+ </style>
+</head>
+
+<body>
+ <!-- This file lives in public/404.html -->
+ <div class="dialog">
+ <h1>The page you were looking for doesn't exist.</h1>
+ <p>You may have mistyped the address or the page may have moved.</p>
+ </div>
+</body>
+</html>
View
30 rhosync-api/store-rails/public/422.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
+ <title>The change you wanted was rejected (422)</title>
+ <style type="text/css">
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
+ div.dialog {
+ width: 25em;
+ padding: 0 4em;
+ margin: 4em auto 0 auto;
+ border: 1px solid #ccc;
+ border-right-color: #999;
+ border-bottom-color: #999;
+ }
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
+ </style>
+</head>
+
+<body>
+ <!-- This file lives in public/422.html -->
+ <div class="dialog">
+ <h1>The change you wanted was rejected.</h1>
+ <p>Maybe you tried to change something you didn't have access to.</p>
+ </div>
+</body>
+</html>
View
30 rhosync-api/store-rails/public/500.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
+ <title>We're sorry, but something went wrong (500)</title>
+ <style type="text/css">
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
+ div.dialog {
+ width: 25em;
+ padding: 0 4em;