Class: RailsPgExtrasWeb::QueriesController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- RailsPgExtrasWeb::QueriesController
- Defined in:
- app/controllers/rails_pg_extras_web/queries_controller.rb
Instance Method Summary collapse
Instance Method Details
#index ⇒ Object
5 |
# File 'app/controllers/rails_pg_extras_web/queries_controller.rb', line 5 def index; end |
#run ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 |
# File 'app/controllers/rails_pg_extras_web/queries_controller.rb', line 7 def run if @query_name = params[:query_name].presence begin @result = RailsPGExtras.run_query(query_name: @query_name.to_sym, in_format: :raw) rescue ActiveRecord::StatementInvalid => e @error = e. end else redirect_to root_path end end |