Class: Store::MembershipsController

Inherits:
StoreController
  • Object
show all
Defined in:
app/controllers/store/memberships_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



11
12
13
14
15
# File 'app/controllers/store/memberships_controller.rb', line 11

def index
  render :nothing => true unless store_organization.can? :access, :membership
  @membership_types = store_organization.membership_types.storefront.sales_valid.order('price desc')
  @membership_kit = MembershipKit.where(:organization_id => store_organization.id).first
end

#showObject



2
3
4
5
6
7
8
9
# File 'app/controllers/store/memberships_controller.rb', line 2

def show
  membership_type = MembershipType.sales_valid.find(params[:id])
  @membership_types = [membership_type]
  @membership_kit = MembershipKit.where(:organization_id => store_organization.id).first
  render :index
rescue ActiveRecord::RecordNotFound 
  raise ActionController::RoutingError.new("Not Found")
end