Class: TestimonialsController
Instance Method Summary
collapse
caches_page_with_cache_marker, #raise_not_found!
Instance Method Details
#create ⇒ Object
34
35
36
37
38
39
40
41
42
43
|
# File 'app/controllers/testimonials_controller.rb', line 34
def create
@testimonial.remote_ip = request.remote_ip
@testimonial.account_id = current_account.id
@testimonial.update_attributes(testimonial_params)
TranslationCms::Api::Report.create_from_params(testimonial_params, ReportType.review)
respond_with @testimonial, location: testimonials_path
end
|
#index ⇒ Object
13
14
15
16
17
18
19
|
# File 'app/controllers/testimonials_controller.rb', line 13
def index
@text = page_text('testimonials-text')
params[:per] = 10 if params[:per].blank? || params[:per].to_i < 1
@testimonials = Testimonial.past.visible.local.page(params[:page]).per(params[:per])
respond_with @testimonials
end
|
#new ⇒ Object
29
30
31
32
|
# File 'app/controllers/testimonials_controller.rb', line 29
def new
@text = page_text('testimonials-text', :footer)
respond_with(@testimonial)
end
|
#search ⇒ Object
21
22
23
24
25
26
27
|
# File 'app/controllers/testimonials_controller.rb', line 21
def search
@text = page_text('testimonials-text')
params[:per] = 10 if params[:per].blank? || params[:per].to_i < 1
@testimonials = Testimonial.past.visible.local.order_first(params[:id]).page(params[:page]).per(params[:per])
respond_with @testimonials, template: 'testimonials/index'
end
|