2

I'm new to Rails and linux world. Question looks very simple but I'm having tough time writing some long commands in console. Say, I have to run some active record queries to see the results in console, below line works perfect

User.find(1)

But I can't type below query as last 3 characters simply gets truncated

Category.includes(:posts => [{:comments => :guest}, :tags]).find(1)

or something weird happens like below

nd(1)-p327 :009 > Category.includes(:posts => [{:comments => :guest}, :tags]).fin

What I need to do to get it work?

1
  • What terminal? Never seen anything like this-define "gets truncated", are you saying that the statement doesn't execute, or you just can't see all of it? Commented Apr 21, 2013 at 18:01

1 Answer 1

5

If you end a line with a period IRB will assume it is a multi-line command:

Category.
includes(:posts => [{:comments => :guest}, :tags]).
find(1)

It's odd that it's getting truncated though. Which terminal application are you using?

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.