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
21 22 23 24 25 26 27 28 29 |
# File 'app/controllers/iron/content_types_controller.rb', line 21 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
39 40 41 42 |
# File 'app/controllers/iron/content_types_controller.rb', line 39 def destroy @content_type.destroy! redirect_to content_types_path, notice: t("iron.content_types.notifications.destroyed"), status: :see_other end |
#edit ⇒ Object
18 19 |
# File 'app/controllers/iron/content_types_controller.rb', line 18 def edit end |
#index ⇒ Object
6 7 8 9 |
# File 'app/controllers/iron/content_types_controller.rb', line 6 def index @content_types = ContentType.order(:name) @grouped_content_types = @content_types.group_by(&:humanized_type) end |
#new ⇒ Object
14 15 16 |
# File 'app/controllers/iron/content_types_controller.rb', line 14 def new @content_type = ContentType.new end |
#show ⇒ Object
11 12 |
# File 'app/controllers/iron/content_types_controller.rb', line 11 def show end |
#update ⇒ Object
31 32 33 34 35 36 37 |
# File 'app/controllers/iron/content_types_controller.rb', line 31 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 |