Class: Api::V1::EmployersController
- Inherits:
-
ApiController
- Object
- ApiController
- Api::V1::EmployersController
- Defined in:
- app/controllers/acts_as_talented/api/v1/employers_controller.rb
Instance Method Summary collapse
Instance Method Details
#index ⇒ Object
9 10 11 12 |
# File 'app/controllers/acts_as_talented/api/v1/employers_controller.rb', line 9 def index employers = Employer.paginate(page: params[:page] || 1 , per_page: params[:per_page] || 10) render json: [{ data: employers, count: Employer.all.size }], status: :ok end |
#update ⇒ Object
14 15 16 17 18 19 20 |
# File 'app/controllers/acts_as_talented/api/v1/employers_controller.rb', line 14 def update if @employer.update_attributes(update_params) render json: @employer, status: :ok else render json: { error: @employer.errors..join(",") }, status: :unprocessable_entity end end |