Questions tagged [rails-console]

the interactive, command-line interface to the Ruby-based Rails framework. The Rails console allows developers to interact directly with their application without using a browser.

441 questions
-1
votes
2 answers

Cannot start rails console in production: invalid option -e

For some reason, we cannot run rails console in production. The command rails console -e production works on our Windows machine but fails on our Mac. This SO post explains how to solve it, but can someone explain why we're seeing this error…
Crashalot
  • 33,605
  • 61
  • 269
  • 439
-1
votes
1 answer

how do I rollback a database transaction in rails

I'm new to rails and have just had my first bad experience with the mighty rails console. I overwrote a column in ALL instead of just one record and after hours of googling I did not find a common way to rollback this stupid transaction (ended up…
DonMB
  • 2,550
  • 3
  • 28
  • 59
-2
votes
2 answers

How to restore the data which are already deleted DB in rails console by using rails commands?

I deleted some data in a database but I want those data back. Is there any way to restore the data from a database that was deleted using the rails console?
-2
votes
1 answer

How to know if a some item or object is using a Model in rails

I have the following situation: A model called State with some info: pry(main)> State.last id: 35, region_id: 6, name: "São Paulo", abbreviation: "SP", created_at: Mon, 03 Jul 2017 09:38:22 -03 -03:00, updated_at: Mon, 03 Jul 2017 09:38:22…
Diego
  • 11
  • 1
  • 1
  • 6
-2
votes
1 answer

When i make an typo error in the rails console, do i have to start all over again?

I have previously entered a few commands then i made a mistake and type pin.save and press enter,instead of typing @pin.save. Do i have to restart the rails console or is their a way to continue with my previous work in the console? In addition I'm…
padawancoder
  • 23
  • 1
  • 8
-5
votes
2 answers

How to or in a ruby on rails Mongodb query?

I need to perform this sql query in rails console (I'm using mongodb): SELECT * FROM Member WHERE name='x' OR age='42'
Aboelseoud
  • 556
  • 1
  • 7
  • 22
1 2 3
29
30