Class: TestimonialsController
- Inherits:
-
AdminController
- Object
- AdminController
- TestimonialsController
- Defined in:
- app/controllers/testimonials_controller.rb
Overview
Handling testimonials
Instance Method Summary collapse
-
#check ⇒ Object
post /testimonials/check.
-
#create ⇒ Object
post /testimonials.
-
#destroy ⇒ Object
delete /testimonials/:id.
-
#edit ⇒ Object
get /testimonials/:id/edit.
-
#new ⇒ Object
get /testimonials/new.
-
#update ⇒ Object
patch /testimonials/:id.
Instance Method Details
#check ⇒ Object
post /testimonials/check
8 9 10 11 12 |
# File 'app/controllers/testimonials_controller.rb', line 8 def check @entity = Testimonial.instance_for_check(params[:entity_id], entity_parameters) render 'shared/forms/check' end |
#create ⇒ Object
post /testimonials
20 21 22 23 24 25 26 27 28 |
# File 'app/controllers/testimonials_controller.rb', line 20 def create @entity = Testimonial.new(entity_parameters) @entity.language = current_language if @entity.save form_processed_ok(admin_testimonial_path(id: @entity.id)) else form_processed_with_error(:new) end end |
#destroy ⇒ Object
delete /testimonials/:id
44 45 46 47 48 |
# File 'app/controllers/testimonials_controller.rb', line 44 def destroy flash[:notice] = t('testimonials.destroy.success') if @entity.destroy redirect_to(admin_testimonials_path) end |
#edit ⇒ Object
get /testimonials/:id/edit
31 32 |
# File 'app/controllers/testimonials_controller.rb', line 31 def edit end |
#new ⇒ Object
get /testimonials/new
15 16 17 |
# File 'app/controllers/testimonials_controller.rb', line 15 def new @entity = Testimonial.new end |
#update ⇒ Object
patch /testimonials/:id
35 36 37 38 39 40 41 |
# File 'app/controllers/testimonials_controller.rb', line 35 def update if @entity.update entity_parameters form_processed_ok(admin_testimonial_path(id: @entity.id)) else form_processed_with_error(:edit) end end |