Sha256: f8900b386e09c543e66be6be6caff163014dded0da673b4fce176db577515c8f
Contents?: true
Size: 1.73 KB
Versions: 12
Compression:
Stored size: 1.73 KB
Contents
class Admin::Muck::SubscriptionPlansController < Admin::Muck::BaseController before_filter :setup_subscription_plan, :only => [:show, :edit, :update, :destroy] def index @subscription_plans = SubscriptionPlan.by_newest.paginate(:page => @page, :per_page => @per_page) render :template => 'admin/subscription_plans/index' end def new @subscription_plans = SubscriptionPlan.new render :template => 'admin/subscription_plans/new' end def show render :template => 'admin/subscription_plans/show' end def edit render :template => 'admin/subscription_plans/edit' end def create flash[:notice] = translate('muck.commerce.subscription_plan_created') @subscription_plan = SubscriptionPlan.create!(params[:subscription_plan]) respond_to do |format| format.html { redirect_to admin_subscription_plan_path(@subscription_plan) } end rescue ActiveRecord::RecordInvalid => ex respond_to do |format| format.html { render :template => 'admin/subscription_plans/new' } end end def update @subscription_plan.update_attributes!(params[:subscription_plan]) flash[:notice] = translate('muck.commerce.subscription_plan_updated') respond_to do |format| format.html { redirect_to admin_subscription_plan_path(@subscription_plan) } end rescue ActiveRecord::RecordInvalid => ex respond_to do |format| format.html { render :template => 'admin/subscription_plans/edit' } end end def destroy flash[:notice] = translate('muck.commerce.subscription_plan_deleted') @subscription_plan.destroy redirect_to admin_subscription_plans_path end protected def setup_subscription_plan @subscription_plan = SubscriptionPlan.find(params[:id]) end end
Version data entries
12 entries across 12 versions & 1 rubygems