Class: Iron::ContentTypesController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Iron::ContentTypesController
- Defined in:
- app/controllers/iron/content_types_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'app/controllers/iron/content_types_controller.rb', line 22 def create @content_type = ContentType.new(content_type_params) if @content_type.save redirect_to @content_type, notice: t("iron.content_types.notifications.created") else render :new, status: :unprocessable_entity end end |
#destroy ⇒ Object
40 41 42 43 |
# File 'app/controllers/iron/content_types_controller.rb', line 40 def destroy @content_type.destroy! redirect_to content_types_path, notice: t("iron.content_types.notifications.destroyed"), status: :see_other end |
#edit ⇒ Object
19 20 |
# File 'app/controllers/iron/content_types_controller.rb', line 19 def edit end |
#index ⇒ Object
7 8 9 10 |
# File 'app/controllers/iron/content_types_controller.rb', line 7 def index @content_types = ContentType.order(:name) @grouped_content_types = @content_types.group_by(&:humanized_type) end |
#new ⇒ Object
15 16 17 |
# File 'app/controllers/iron/content_types_controller.rb', line 15 def new @content_type = ContentType.new end |
#show ⇒ Object
12 13 |
# File 'app/controllers/iron/content_types_controller.rb', line 12 def show end |
#update ⇒ Object
32 33 34 35 36 37 38 |
# File 'app/controllers/iron/content_types_controller.rb', line 32 def update if @content_type.update(content_type_params) redirect_to @content_type, notice: t("iron.content_types.notifications.updated"), status: :see_other else render :edit, status: :unprocessable_entity end end |