Class: PhcdevworksCoreModules::Marketing::OptimizationsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/phcdevworks_core_modules/marketing/optimizations_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject

POST /marketing/optimizations



31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'app/controllers/phcdevworks_core_modules/marketing/optimizations_controller.rb', line 31

def create
    @marketing_optimization = Marketing::Optimization.new(marketing_optimization_params)
    @marketing_optimization.user_id = current_user.id
    @marketing_optimization.org_id = current_user.org_id
    respond_to do |format|
        if @marketing_optimization.save
            format.html { redirect_to marketing_optimizations_path, :flash => { :success => 'SEO Attributes has been Added.' }}
            format.json { render :show, status: :created, location: @marketing_optimization }
        else
            format.html { render :new }
            format.json { render json: @marketing_optimization.errors, status: :unprocessable_entity }
        end
    end
end

#destroyObject

DELETE /marketing/optimizations/1



60
61
62
63
64
65
66
# File 'app/controllers/phcdevworks_core_modules/marketing/optimizations_controller.rb', line 60

def destroy
    @marketing_optimization.destroy
    respond_to do |format|
        format.html { redirect_to marketing_optimizations_path, :flash => { :error => 'SEO Attributes and Post Connections have all been Removed.' }}
        format.json { head :no_content }
    end
end

#editObject

GET /marketing/optimizations/1/edit



27
28
# File 'app/controllers/phcdevworks_core_modules/marketing/optimizations_controller.rb', line 27

def edit
end

#indexObject

GET /marketing/optimizations



13
14
15
# File 'app/controllers/phcdevworks_core_modules/marketing/optimizations_controller.rb', line 13

def index
    @marketing_optimizations = Marketing::Optimization.order('marketing_optimization_page_title ASC')
end

#newObject

GET /marketing/optimizations/new



22
23
24
# File 'app/controllers/phcdevworks_core_modules/marketing/optimizations_controller.rb', line 22

def new
    @marketing_optimization = Marketing::Optimization.new
end

#showObject

GET /marketing/optimizations/1



18
19
# File 'app/controllers/phcdevworks_core_modules/marketing/optimizations_controller.rb', line 18

def show
end

#updateObject

PATCH/PUT /marketing/optimizations/1



47
48
49
50
51
52
53
54
55
56
57
# File 'app/controllers/phcdevworks_core_modules/marketing/optimizations_controller.rb', line 47

def update
    respond_to do |format|
        if @marketing_optimization.update(marketing_optimization_params)
            format.html { redirect_to marketing_optimizations_path, :flash => { :notice => 'SEO Attributes has been Updated.' }}
            format.json { render :show, status: :ok, location: @marketing_optimization }
        else
            format.html { render :edit }
            format.json { render json: @marketing_optimization.errors, status: :unprocessable_entity }
        end
    end
end