Class: Saasaparilla::Admin::PlansController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Saasaparilla::Admin::PlansController
- Defined in:
- app/controllers/saasaparilla/admin/plans_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /plans POST /plans.xml.
-
#destroy ⇒ Object
DELETE /plans/1 DELETE /plans/1.xml.
-
#edit ⇒ Object
GET /plans/1/edit.
-
#index ⇒ Object
GET /plans GET /plans.xml.
-
#new ⇒ Object
GET /plans/new GET /plans/new.xml.
-
#show ⇒ Object
GET /plans/1 GET /plans/1.xml.
-
#update ⇒ Object
PUT /plans/1 PUT /plans/1.xml.
Methods included from Authorization::InstanceMethods
Methods included from Authentication::InstanceMethods
included, #require_current_billable
Instance Method Details
#create ⇒ Object
POST /plans POST /plans.xml
46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'app/controllers/saasaparilla/admin/plans_controller.rb', line 46 def create @plan = Plan.new(params[:plan]) respond_to do |format| if @plan.save format.html { redirect_to(admin_plans_path, :notice => 'Plan was successfully created.') } format.xml { render :xml => @plan, :status => :created, :location => @plan } else format.html { render :action => "new" } format.xml { render :xml => @plan.errors, :status => :unprocessable_entity } end end end |
#destroy ⇒ Object
DELETE /plans/1 DELETE /plans/1.xml
78 79 80 81 82 83 84 85 86 |
# File 'app/controllers/saasaparilla/admin/plans_controller.rb', line 78 def destroy @plan = Plan.find(params[:id]) @plan.destroy respond_to do |format| format.html { redirect_to(admin_plans_url) } format.xml { head :ok } end end |
#edit ⇒ Object
GET /plans/1/edit
40 41 42 |
# File 'app/controllers/saasaparilla/admin/plans_controller.rb', line 40 def edit @plan = Plan.find(params[:id]) end |
#index ⇒ Object
GET /plans GET /plans.xml
8 9 10 11 12 13 14 15 |
# File 'app/controllers/saasaparilla/admin/plans_controller.rb', line 8 def index @plans = Plan.all respond_to do |format| format.html # index.html.erb format.xml { render :xml => @plans } end end |
#new ⇒ Object
GET /plans/new GET /plans/new.xml
30 31 32 33 34 35 36 37 |
# File 'app/controllers/saasaparilla/admin/plans_controller.rb', line 30 def new @plan = Plan.new respond_to do |format| format.html # new.html.erb format.xml { render :xml => @plan } end end |
#show ⇒ Object
GET /plans/1 GET /plans/1.xml
19 20 21 22 23 24 25 26 |
# File 'app/controllers/saasaparilla/admin/plans_controller.rb', line 19 def show @plan = Plan.find(params[:id]) respond_to do |format| format.html # show.html.erb format.xml { render :xml => @plan } end end |
#update ⇒ Object
PUT /plans/1 PUT /plans/1.xml
62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'app/controllers/saasaparilla/admin/plans_controller.rb', line 62 def update @plan = Plan.find(params[:id]) respond_to do |format| if @plan.update_attributes(params[:plan]) format.html { redirect_to(admin_plans_path, :notice => 'Plan was successfully updated.') } format.xml { head :ok } else format.html { render :action => "edit" } format.xml { render :xml => @plan.errors, :status => :unprocessable_entity } end end end |