Class: BusinessActivitiesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/business_activities_controller.rb

Instance Method Summary collapse

Methods included from SessionsHelper

#preferences_customer_type=, #preferences_customer_type?, #signed_in?, #signed_in_user, #store_location

Instance Method Details

#createObject

POST /business_activities POST /business_activities.json



46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'app/controllers/business_activities_controller.rb', line 46

def create
  #@business_activity = BusinessActivity.new(params[:business_activity])

  respond_to do |format|
    if @business_activity.save
      format.html { redirect_to @business_activity, notice: 'Business activity was successfully created.' }
      format.json { render json: @business_activity, status: :created, location: @business_activity }
    else
      format.html { render action: "new" }
      format.json { render json: @business_activity.errors, status: :unprocessable_entity }
    end
  end
end

#destroyObject

DELETE /business_activities/1 DELETE /business_activities/1.json



78
79
80
81
82
83
84
85
86
# File 'app/controllers/business_activities_controller.rb', line 78

def destroy
  #@business_activity = BusinessActivity.find(params[:id])
  @business_activity.destroy

  respond_to do |format|
    format.html { redirect_to business_activities_url }
    format.json { head :no_content }
  end
end

#updateObject

PUT /business_activities/1 PUT /business_activities/1.json



62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'app/controllers/business_activities_controller.rb', line 62

def update
  #@business_activity = BusinessActivity.find(params[:id])

  respond_to do |format|
    if @business_activity.update_attributes(params[:business_activity])
      format.html { redirect_to @business_activity, notice: 'Business activity was successfully updated.' }
      format.json { head :no_content }
    else
      format.html { render action: "edit" }
      format.json { render json: @business_activity.errors, status: :unprocessable_entity }
    end
  end
end