Class: PostTypesController
Instance Method Summary
collapse
#dashboard, #keyboard_tools, #upload
Instance Method Details
#create ⇒ Object
23
24
25
26
27
28
29
30
31
|
# File 'app/controllers/post_types_controller.rb', line 23
def create
@type = PostType.new post_type_params
if @type.save
clear_cache!
redirect_to post_types_path
else
render :new
end
end
|
#edit ⇒ Object
33
|
# File 'app/controllers/post_types_controller.rb', line 33
def edit; end
|
#index ⇒ Object
6
7
8
|
# File 'app/controllers/post_types_controller.rb', line 6
def index
@types = PostType.all
end
|
#list ⇒ Object
10
11
12
13
14
15
16
17
|
# File 'app/controllers/post_types_controller.rb', line 10
def list
@types = PostType.all
respond_to do |format|
format.json do
render json: @types
end
end
end
|
#new ⇒ Object
19
20
21
|
# File 'app/controllers/post_types_controller.rb', line 19
def new
@type = PostType.new
end
|
#update ⇒ Object
35
36
37
38
39
40
41
42
|
# File 'app/controllers/post_types_controller.rb', line 35
def update
if @type.update post_type_params
clear_cache!
redirect_to post_types_path
else
render :edit
end
end
|