Class: HrEngine6::ClientsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- HrEngine6::ClientsController
- Defined in:
- app/controllers/hr_engine6/clients_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /clients POST /clients.json.
-
#destroy ⇒ Object
DELETE /clients/1 DELETE /clients/1.json.
-
#edit ⇒ Object
GET /clients/1/edit.
-
#index ⇒ Object
GET /clients GET /clients.json.
-
#new ⇒ Object
GET /clients/new.
-
#show ⇒ Object
GET /clients/1 GET /clients/1.json.
-
#update ⇒ Object
PATCH/PUT /clients/1 PATCH/PUT /clients/1.json.
Instance Method Details
#create ⇒ Object
POST /clients POST /clients.json
29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'app/controllers/hr_engine6/clients_controller.rb', line 29 def create @client = Client.new(client_params) respond_to do |format| if @client.save format.html { redirect_to @client, notice: 'Client was successfully created.' } format.json { render :show, status: :created, location: @client } else format.html { render :new } format.json { render json: @client.errors, status: :unprocessable_entity } end end end |
#destroy ⇒ Object
DELETE /clients/1 DELETE /clients/1.json
59 60 61 62 63 64 65 |
# File 'app/controllers/hr_engine6/clients_controller.rb', line 59 def destroy @client.destroy respond_to do |format| format.html { redirect_to clients_url, notice: 'Client was successfully destroyed.' } format.json { head :no_content } end end |
#edit ⇒ Object
GET /clients/1/edit
24 25 |
# File 'app/controllers/hr_engine6/clients_controller.rb', line 24 def edit end |
#index ⇒ Object
GET /clients GET /clients.json
9 10 11 |
# File 'app/controllers/hr_engine6/clients_controller.rb', line 9 def index @clients = Client.all end |
#new ⇒ Object
GET /clients/new
19 20 21 |
# File 'app/controllers/hr_engine6/clients_controller.rb', line 19 def new @client = Client.new end |
#show ⇒ Object
GET /clients/1 GET /clients/1.json
15 16 |
# File 'app/controllers/hr_engine6/clients_controller.rb', line 15 def show end |
#update ⇒ Object
PATCH/PUT /clients/1 PATCH/PUT /clients/1.json
45 46 47 48 49 50 51 52 53 54 55 |
# File 'app/controllers/hr_engine6/clients_controller.rb', line 45 def update respond_to do |format| if @client.update(client_params) format.html { redirect_to @client, notice: 'Client was successfully updated.' } format.json { render :show, status: :ok, location: @client } else format.html { render :edit } format.json { render json: @client.errors, status: :unprocessable_entity } end end end |