Class: PleskKit::ResellerAccountsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- PleskKit::ResellerAccountsController
- Defined in:
- app/controllers/plesk_kit/reseller_accounts_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /reseller_accounts POST /reseller_accounts.json.
-
#destroy ⇒ Object
DELETE /reseller_accounts/1 DELETE /reseller_accounts/1.json.
-
#edit ⇒ Object
GET /reseller_accounts/1/edit.
-
#index ⇒ Object
GET /reseller_accounts GET /reseller_accounts.json.
-
#new ⇒ Object
GET /reseller_accounts/new GET /reseller_accounts/new.json.
-
#show ⇒ Object
GET /reseller_accounts/1 GET /reseller_accounts/1.json.
-
#update ⇒ Object
PUT /reseller_accounts/1 PUT /reseller_accounts/1.json.
Instance Method Details
#create ⇒ Object
POST /reseller_accounts POST /reseller_accounts.json
45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'app/controllers/plesk_kit/reseller_accounts_controller.rb', line 45 def create @reseller_account = ResellerAccount.new(params[:reseller_account]) respond_to do |format| if @reseller_account.save format.html { redirect_to @reseller_account, notice: 'Reseller account was successfully created.' } format.json { render json: @reseller_account, status: :created, location: @reseller_account } else format.html { render action: "new" } format.json { render json: @reseller_account.errors, status: :unprocessable_entity } end end end |
#destroy ⇒ Object
DELETE /reseller_accounts/1 DELETE /reseller_accounts/1.json
77 78 79 80 81 82 83 84 85 |
# File 'app/controllers/plesk_kit/reseller_accounts_controller.rb', line 77 def destroy @reseller_account = ResellerAccount.find(params[:id]) @reseller_account.destroy respond_to do |format| format.html { redirect_to reseller_accounts_url } format.json { head :no_content } end end |
#edit ⇒ Object
GET /reseller_accounts/1/edit
39 40 41 |
# File 'app/controllers/plesk_kit/reseller_accounts_controller.rb', line 39 def edit @reseller_account = ResellerAccount.find(params[:id]) end |
#index ⇒ Object
GET /reseller_accounts GET /reseller_accounts.json
7 8 9 10 11 12 13 14 |
# File 'app/controllers/plesk_kit/reseller_accounts_controller.rb', line 7 def index @reseller_accounts = ResellerAccount.all respond_to do |format| format.html # index.html.erb format.json { render json: @reseller_accounts } end end |
#new ⇒ Object
GET /reseller_accounts/new GET /reseller_accounts/new.json
29 30 31 32 33 34 35 36 |
# File 'app/controllers/plesk_kit/reseller_accounts_controller.rb', line 29 def new @reseller_account = ResellerAccount.new respond_to do |format| format.html # new.html.erb format.json { render json: @reseller_account } end end |
#show ⇒ Object
GET /reseller_accounts/1 GET /reseller_accounts/1.json
18 19 20 21 22 23 24 25 |
# File 'app/controllers/plesk_kit/reseller_accounts_controller.rb', line 18 def show @reseller_account = ResellerAccount.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @reseller_account } end end |
#update ⇒ Object
PUT /reseller_accounts/1 PUT /reseller_accounts/1.json
61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'app/controllers/plesk_kit/reseller_accounts_controller.rb', line 61 def update @reseller_account = ResellerAccount.find(params[:id]) respond_to do |format| if @reseller_account.update_attributes(params[:reseller_account]) format.html { redirect_to @reseller_account, notice: 'Reseller account was successfully updated.' } format.json { head :no_content } else format.html { render action: "edit" } format.json { render json: @reseller_account.errors, status: :unprocessable_entity } end end end |