Class: Renalware::Clinics::AppointmentsController
- Inherits:
-
BaseController
- Object
- ApplicationController
- ApplicationController
- BaseController
- Renalware::Clinics::AppointmentsController
- Includes:
- Renalware::Concerns::Pageable
- Defined in:
- app/controllers/renalware/clinics/appointments_controller.rb
Instance Method Summary collapse
Methods inherited from BaseController
Instance Method Details
#create ⇒ Object
28 29 30 31 32 33 34 35 36 37 |
# File 'app/controllers/renalware/clinics/appointments_controller.rb', line 28 def create appointment = Appointment.new(appointment_params) appointment.user = current_user appointment if appointment.save redirect_to appointments_path, notice: t(".success", model_name: "Appointment") else render_new(appointment) end end |
#index ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'app/controllers/renalware/clinics/appointments_controller.rb', line 10 def index appointments_query = AppointmentQuery.new(query_params) appointments = appointments_query.call.page(page).per(per_page) appointments render :index, locals: { appointments: appointments, query: appointments_query.search, clinics: Clinic.ordered, users: User.ordered, request_html_form_params: build_params_for_html_form(appointments) } end |
#new ⇒ Object
24 25 26 |
# File 'app/controllers/renalware/clinics/appointments_controller.rb', line 24 def new render_new(Appointment.new) end |