1
0
mirror of https://github.com/fspc/BikeShed-1.git synced 2025-02-28 16:53:23 -05:00

expose is awesome

This commit is contained in:
Jason Denney 2012-12-09 13:15:57 -05:00
parent 8d488c86a0
commit 4ae03fc563
2 changed files with 2 additions and 20 deletions

View File

@ -1,14 +1,5 @@
class BikeBrandsController < AuthenticatedController class BikeBrandsController < AuthenticatedController
expose(:bike_brand) do expose(:bike_brand)
if params[:id]
BikeBrand.find(params[:id])
elsif params[:bike_brand]
BikeBrand.new(params[:bike_brand])
else
BikeBrand.new
end
end
expose(:bike_brands) { BikeBrand.order('id').paginate(:page => params[:page]) } expose(:bike_brands) { BikeBrand.order('id').paginate(:page => params[:page]) }
def index def index

View File

@ -1,14 +1,5 @@
class BikeModelsController < AuthenticatedController class BikeModelsController < AuthenticatedController
expose(:bike_model) do expose(:bike_model)
if params[:id]
BikeModel.find(params[:id])
elsif params[:bike_model]
BikeModel.new(params[:bike_model])
else
BikeModel.new
end
end
expose(:bike_models) { BikeModel.order('id').paginate(:page => params[:page]) } expose(:bike_models) { BikeModel.order('id').paginate(:page => params[:page]) }
def index def index