Velocipede's User, Sales, and Bike Inventory Web App
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

30 lines
820 B

class BikeModels < Netzke::Basepack::Grid
def configure(c)
super
c.model = "BikeModel"
c.title = "Models"
c.force_fit = true
c.data_store = {auto_load: false}
c.scope = lambda { |rel| rel.where(:bike_brand_id => session[:selected_bike_brand_id]);}
c.strong_default_attrs = {
:bike_brand_id => session[:selected_bike_brand_id]
}
c.columns = [
{ :name => :model }
]
c.prohibit_update = true if cannot? :update, BikeModel
c.prohibit_create = true if cannot? :create, BikeModel
c.prohibit_delete = true if cannot? :delete, BikeModel
end
#override with nil to remove actions
def default_bbar
bbar = [ :search ]
bbar.concat [ :apply ] if can? :update, BikeModel
bbar.concat [ :add_in_form ] if can? :create, BikeModel
bbar
end
end