Class: Publinator::Manage::PublishableTypesController
Instance Method Summary
collapse
#body_id, #current_controller, #current_domain, #current_layout, #current_site, #current_site_name
Instance Method Details
#create ⇒ Object
33
34
35
36
37
38
39
40
41
42
43
44
|
# File 'app/controllers/publinator/manage/publishable_types_controller.rb', line 33
def create
@manage_publishable_type = Manage::PublishableType.new(params[:manage_publishable_type])
respond_to do |format|
if @manage_publishable_type.save
format.html { redirect_to manage_publishable_types_path, notice: 'Publishable type was successfully created.' }
format.json { render json: @manage_publishable_type, status: :created, location: @manage_publishable_type }
else
format.html { render action: "new" }
format.json { render json: @manage_publishable_type.errors, status: :unprocessable_entity }
end
end
end
|
#destroy ⇒ Object
59
60
61
62
63
64
65
66
|
# File 'app/controllers/publinator/manage/publishable_types_controller.rb', line 59
def destroy
@manage_publishable_type = Publinator::PublishableType.find(params[:id])
@manage_publishable_type.destroy
respond_to do |format|
format.html { redirect_to manage_publishable_types_url }
format.json { head :no_content }
end
end
|
#edit ⇒ Object
29
30
31
|
# File 'app/controllers/publinator/manage/publishable_types_controller.rb', line 29
def edit
@publishable_type = PublishableType.find(params[:id])
end
|
#index ⇒ Object
3
4
5
6
7
8
9
|
# File 'app/controllers/publinator/manage/publishable_types_controller.rb', line 3
def index
@publishable_types = Publinator::PublishableType.all
respond_to do |format|
format.html format.json { render json: @manage_publishable_types }
end
end
|
#new ⇒ Object
20
21
22
23
24
25
26
27
|
# File 'app/controllers/publinator/manage/publishable_types_controller.rb', line 20
def new
@manage_publishable_type = Manage::PublishableType.new
respond_to do |format|
format.html format.json { render json: @manage_publishable_type }
end
end
|
#show ⇒ Object
11
12
13
14
15
16
17
18
|
# File 'app/controllers/publinator/manage/publishable_types_controller.rb', line 11
def show
@manage_publishable_type = Manage::PublishableType.find(params[:id])
respond_to do |format|
format.html format.json { render json: @manage_publishable_type }
end
end
|
#update ⇒ Object
46
47
48
49
50
51
52
53
54
55
56
57
|
# File 'app/controllers/publinator/manage/publishable_types_controller.rb', line 46
def update
@manage_publishable_type = Publinator::PublishableType.find(params[:id])
respond_to do |format|
if @manage_publishable_type.update_attributes(params[:manage_publishable_type])
format.html { redirect_to manage_publishable_types_path, notice: 'Publishable type was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: "edit" }
format.json { render json: @manage_publishable_type.errors, status: :unprocessable_entity }
end
end
end
|