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:
parent
8d488c86a0
commit
4ae03fc563
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user