Category: rails


How to see the sql statements for rails commands

Just type the fol­low­ing com­mand in your rails con­sole to see the sql out­put of your rails com­mands ActiveRecord::Base.logger = NOTE: You will prob­a­bly have to do this for every ses­sion. To avoid that, add…


Capybara find_field to find a disabled field

By default find_field in capy­bara only finds an enabled field. To find a dis­abled field, you can pass in a sec­ond argu­ment as an options hash. For exam­ple, to find a field that is…


Ruby on Rails cheatsheet

Cre­at­ing a new rails project Using MySQL as the data­base rails new myapp –d mysql Using post­gres as the data­base rails new myapp –d post­gresql Installing Gems To man­u­ally install gems that you add,…