Class: PgRest::TablesController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- PgRest::TablesController
- Defined in:
- app/controllers/pg_rest/tables_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
Instance Method Details
#create ⇒ Object
17 18 19 20 |
# File 'app/controllers/pg_rest/tables_controller.rb', line 17 def create PgService.create_table(table_name: pg_params[:name]) render json: { message: 'Table created.' } end |
#destroy ⇒ Object
22 23 24 25 |
# File 'app/controllers/pg_rest/tables_controller.rb', line 22 def destroy PgService.drop_table(table_name: params[:id]) render json: { message: 'Table dropped.' } end |
#index ⇒ Object
7 8 9 10 |
# File 'app/controllers/pg_rest/tables_controller.rb', line 7 def index schema = PgRest::Schema.pg_schema render json: { data: schema } end |
#show ⇒ Object
12 13 14 15 |
# File 'app/controllers/pg_rest/tables_controller.rb', line 12 def show table = PgRest::Schema.table_schema(params[:id]) render json: { data: table } end |