Priya Sharma

Joined

60 Experience
0 Lessons Completed
0 Questions Solved

Activity

How can I convert this code to raw sql and use in rails? Because When I deploy this code in Heroku, there is a request timeout error. I think this will be faster if I use raw sql.

@payments = PaymentDetail.joins(:project).order('payment_details.created_at desc')
@payment_errors = PaymentError.joins(:project).order('payment_errors.created_at desc')

@all_payments = (@payments + @payment_errors)

The bin/rails server command launches a web server named Puma which comes bundled with Rails. You'll use this any time you want to access your application through a web browser.

With no further work, bin/rails server will run our new shiny Rails app:

$ cd my_app
$ bin/rails server
=> Booting Puma
=> Rails 7.0.0 application starting in development
=> Run bin/rails server --help for more startup options
Puma starting in single mode...

  • Version 3.12.1 (ruby 2.5.7-p206), codename: Llamas in Pajamas
  • Min threads: 5, max threads: 5
  • Environment: development
  • Listening on tcp://localhost:3000 Use Ctrl-C to stop Copy With just three commands we whipped up a Rails server listening on port 3000. Go to your browser and open Localhost:3000, you will see a basic Rails app running.

You can also use the alias "s" to start the server: bin/rails s.

The server can be run on a different port using the -p option. The default development environment can be changed using -e.

$ bin/rails server -e production -p 4000
Copy
The -b option binds Rails to the specified IP, by default it is localhost. You can run a server as a daemon by passing a -d option.