Commit 73bc2a6

mo khan <mo@mokhan.ca>
2013-04-03 03:00:42
try formotion for rendering a quick review form
1 parent ef8a605
app/app_delegate.rb
@@ -1,9 +1,34 @@
 class AppDelegate
   def application(application, didFinishLaunchingWithOptions:launchOptions)
     @window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds)
-    controller_factory = ControllerFactory.new
-    @window.rootViewController = UINavigationController.alloc.initWithRootViewController(controller_factory.create(SearchController))
+    #controller_factory = ControllerFactory.new
+    #@window.rootViewController = UINavigationController.alloc.initWithRootViewController(controller_factory.create(SearchController))
+    #@window.makeKeyAndVisible
+
+    @form = Formotion::Form.new({
+      sections: [
+        {
+          title: "Review",
+          rows: [
+            { title: "Broth", key: :slider, type: :slider, range: (1..10), value: 7 },
+            { title: "Beef", key: :slider, type: :slider, range: (1..10), value: 7 },
+            { title: "Noodles", key: :slider, type: :slider, range: (1..10), value: 7 },
+            { title: "Vegetables", key: :slider, type: :slider, range: (1..10), value: 7 },
+            { title: "Bowl Size", key: :slider, type: :slider, range: (1..10), value: 7 },
+            { title: "Sauces", key: :slider, type: :slider, range: (1..10), value: 7 },
+            { title: "Presentation", key: :slider, type: :slider, range: (1..10), value: 7 },
+            { title: "Ambiance", key: :slider, type: :slider, range: (1..10), value: 7 },
+          ]
+        },
+        {
+          rows: [ { title: "Submit", type: :submit, }]
+        }]
+    })
+
+    @form_controller = Formotion::FormController.alloc.initWithForm(@form)
+    @window.rootViewController = @form_controller
     @window.makeKeyAndVisible
+
     true
   end
 end
Gemfile
@@ -1,2 +1,3 @@
 source "https://rubygems.org"
 gem 'bubble-wrap'
+gem 'formotion'
Gemfile.lock
@@ -2,9 +2,12 @@ GEM
   remote: https://rubygems.org/
   specs:
     bubble-wrap (1.1.5)
+    formotion (1.3)
+      bubble-wrap (>= 1.1.4)
 
 PLATFORMS
   ruby
 
 DEPENDENCIES
   bubble-wrap
+  formotion