How to create a custom method for the rails console?

前端 未结 3 1970
情话喂你
情话喂你 2021-01-06 04:54

When I\'m using the Rails console in Ubuntu for a long session I define the clear method:

def clear; system \'clear\' end

So when m

3条回答
  •  甜味超标
    2021-01-06 05:05

    Put this function to ~/.irbrc

    def clear
      system 'clear'
    end
    

    Then it'll be available when you run irb.

提交回复
热议问题