Class: PgRest::ColumnsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- PgRest::ColumnsController
- Defined in:
- app/controllers/pg_rest/columns_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
Instance Method Details
#create ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'app/controllers/pg_rest/columns_controller.rb', line 8 def create result = PgService.add_column( table_name: params[:table_id], name: pg_params[:name], type: pg_params[:type], default: pg_params[:default], array: pg_params[:array], primary_key: pg_params[:primary_key], foreign_key: pg_params[:foreign_key] ) render json: { message: 'Column added.', data: result } end |
#destroy ⇒ Object
21 22 23 24 25 26 27 |
# File 'app/controllers/pg_rest/columns_controller.rb', line 21 def destroy result = PgService.remove_column( table_name: params[:table_id], name: params[:id] ) render json: { message: 'Column removed.', data: result } end |