Class: CompanyBusinessesController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- CompanyBusinessesController
- Defined in:
- app/controllers/company_businesses_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /company_businesses POST /company_businesses.json.
-
#destroy ⇒ Object
DELETE /company_businesses/1 DELETE /company_businesses/1.json.
-
#update ⇒ Object
PUT /company_businesses/1 PUT /company_businesses/1.json.
Methods included from SessionsHelper
#preferences_customer_type=, #preferences_customer_type?, #signed_in?, #signed_in_user, #store_location
Instance Method Details
#create ⇒ Object
POST /company_businesses POST /company_businesses.json
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'app/controllers/company_businesses_controller.rb', line 8 def create respond_to do |format| if @company_business.save format.html { redirect_to @company_business, notice: 'Company business was successfully created.' } format.json { render json: @company_business, status: :created, location: @company_business } else format.html { render action: "new" } format.json { render json: @company_business.errors, status: :unprocessable_entity } end end end |
#destroy ⇒ Object
DELETE /company_businesses/1 DELETE /company_businesses/1.json
38 39 40 41 42 43 44 45 |
# File 'app/controllers/company_businesses_controller.rb', line 38 def destroy @company_business.destroy respond_to do |format| format.html { redirect_to company_businesses_url } format.json { head :no_content } end end |
#update ⇒ Object
PUT /company_businesses/1 PUT /company_businesses/1.json
23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'app/controllers/company_businesses_controller.rb', line 23 def update respond_to do |format| if @company_business.update_attributes(params[:company_business]) format.html { redirect_to @company_business, notice: 'Company business was successfully updated.' } format.json { head :no_content } else format.html { render action: "edit" } format.json { render json: @company_business.errors, status: :unprocessable_entity } end end end |