From 4ae03fc56367d4905cbf8f59a6dba922a59dcb83 Mon Sep 17 00:00:00 2001 From: Jason Denney Date: Sun, 9 Dec 2012 13:15:57 -0500 Subject: [PATCH] expose is awesome --- app/controllers/bike_brands_controller.rb | 11 +---------- app/controllers/bike_models_controller.rb | 11 +---------- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/app/controllers/bike_brands_controller.rb b/app/controllers/bike_brands_controller.rb index 373ef2a..20874c0 100644 --- a/app/controllers/bike_brands_controller.rb +++ b/app/controllers/bike_brands_controller.rb @@ -1,14 +1,5 @@ class BikeBrandsController < AuthenticatedController - expose(:bike_brand) do - if params[:id] - BikeBrand.find(params[:id]) - elsif params[:bike_brand] - BikeBrand.new(params[:bike_brand]) - else - BikeBrand.new - end - end - + expose(:bike_brand) expose(:bike_brands) { BikeBrand.order('id').paginate(:page => params[:page]) } def index diff --git a/app/controllers/bike_models_controller.rb b/app/controllers/bike_models_controller.rb index 658722e..d15d5de 100644 --- a/app/controllers/bike_models_controller.rb +++ b/app/controllers/bike_models_controller.rb @@ -1,14 +1,5 @@ class BikeModelsController < AuthenticatedController - expose(:bike_model) do - if params[:id] - BikeModel.find(params[:id]) - elsif params[:bike_model] - BikeModel.new(params[:bike_model]) - else - BikeModel.new - end - end - + expose(:bike_model) expose(:bike_models) { BikeModel.order('id').paginate(:page => params[:page]) } def index