Commit d8548f2

mo khan <mo@mokhan.ca>
2013-03-31 18:03:38
add a listing controller to list all the reviews
1 parent 10adb82
Changed files (2)
app/controllers/listing_controller.rb
@@ -0,0 +1,16 @@
+class ListingController < UIViewController
+
+  def viewDidLoad
+    super
+    self.view.backgroundColor = UIColor.whiteColor
+    self.title = "Latest Reviews"
+
+    rightButton = UIBarButtonItem.alloc.initWithTitle("Share", style: UIBarButtonItemStyleBordered, target: self, action: 'push')
+    self.navigationItem.rightBarButtonItem = rightButton
+  end
+
+  def push
+    new_controller = RestaurantController.alloc.initWithNibName(nil, bundle: nil)
+    self.navigationController.pushViewController(new_controller, animated: true)
+  end
+end
app/app_delegate.rb
@@ -2,7 +2,7 @@ class AppDelegate
   def application(application, didFinishLaunchingWithOptions:launchOptions)
 
     @window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds)
-    @location_controller = RestaurantController.alloc.initWithNibName(nil, bundle:nil)
+    @location_controller = ListingController.alloc.initWithNibName(nil, bundle:nil)
     @navigation_controller = UINavigationController.alloc.initWithRootViewController(@location_controller)
 
     @window.rootViewController = @navigation_controller