Class: Account::Scaffolding::AbsolutelyAbstract::CreativeConceptsController

Inherits:
ApplicationController
  • Object
show all
Includes:
Scaffolding::AbsolutelyAbstract::CreativeConcepts::ControllerSupport
Defined in:
app/controllers/account/scaffolding/absolutely_abstract/creative_concepts_controller.rb

Instance Method Summary collapse

Methods included from Scaffolding::AbsolutelyAbstract::CreativeConcepts::ControllerSupport

#ensure_current_user_can_manage_creative_concept

Instance Method Details

#createObject

POST /account/teams/:team_id/scaffolding/absolutely_abstract/creative_concepts POST /account/teams/:team_id/scaffolding/absolutely_abstract/creative_concepts.json



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'app/controllers/account/scaffolding/absolutely_abstract/creative_concepts_controller.rb', line 29

def create
  respond_to do |format|
    if @creative_concept.save

      # any user adding a creative concept should be able to manage it.
      ensure_current_user_can_manage_creative_concept @creative_concept

      format.html { redirect_to [:account, @creative_concept], notice: I18n.t("scaffolding/absolutely_abstract/creative_concepts.notifications.created") }
      format.json { render :show, status: :created, location: [:account, @team, @creative_concept] }
    else
      format.html { render :new, status: :unprocessable_entity }
      format.json { render json: @creative_concept.errors, status: :unprocessable_entity }
    end
  end
end

#destroyObject

DELETE /account/scaffolding/absolutely_abstract/creative_concepts/:id DELETE /account/scaffolding/absolutely_abstract/creative_concepts/:id.json



61
62
63
64
65
66
67
# File 'app/controllers/account/scaffolding/absolutely_abstract/creative_concepts_controller.rb', line 61

def destroy
  @creative_concept.destroy
  respond_to do |format|
    format.html { redirect_to [:account, @team, :scaffolding, :absolutely_abstract, :creative_concepts], notice: I18n.t("scaffolding/absolutely_abstract/creative_concepts.notifications.destroyed") }
    format.json { head :no_content }
  end
end

#editObject

GET /account/scaffolding/absolutely_abstract/creative_concepts/:id/edit



24
25
# File 'app/controllers/account/scaffolding/absolutely_abstract/creative_concepts_controller.rb', line 24

def edit
end

#indexObject

GET /account/teams/:team_id/scaffolding/absolutely_abstract/creative_concepts GET /account/teams/:team_id/scaffolding/absolutely_abstract/creative_concepts.json



8
9
10
11
12
# File 'app/controllers/account/scaffolding/absolutely_abstract/creative_concepts_controller.rb', line 8

def index
  # since we're showing creative_concepts on the team show page by default,
  # we might as well just go there.
  # redirect_to [:account, @team]
end

#newObject

GET /account/teams/:team_id/scaffolding/absolutely_abstract/creative_concepts/new



20
21
# File 'app/controllers/account/scaffolding/absolutely_abstract/creative_concepts_controller.rb', line 20

def new
end

#showObject

GET /account/scaffolding/absolutely_abstract/creative_concepts/:id GET /account/scaffolding/absolutely_abstract/creative_concepts/:id.json



16
17
# File 'app/controllers/account/scaffolding/absolutely_abstract/creative_concepts_controller.rb', line 16

def show
end

#updateObject

PATCH/PUT /account/scaffolding/absolutely_abstract/creative_concepts/:id PATCH/PUT /account/scaffolding/absolutely_abstract/creative_concepts/:id.json



47
48
49
50
51
52
53
54
55
56
57
# File 'app/controllers/account/scaffolding/absolutely_abstract/creative_concepts_controller.rb', line 47

def update
  respond_to do |format|
    if @creative_concept.update(creative_concept_params)
      format.html { redirect_to [:account, @creative_concept], notice: I18n.t("scaffolding/absolutely_abstract/creative_concepts.notifications.updated") }
      format.json { render :show, status: :ok, location: [:account, @creative_concept] }
    else
      format.html { render :edit, status: :unprocessable_entity }
      format.json { render json: @creative_concept.errors, status: :unprocessable_entity }
    end
  end
end