Ruby - nimrody/knowledgebase GitHub Wiki
Useful
-
Iterate over lines of stdin:
ruby -nle 'print $_'
(or usea=$_.split
to get the words of the line)
Rails authentication
Rails console
-
Execute SQL from the rails console
ActiveRecord::Base.connection.execute("TRUNCATE table_name")
-
Test path helpers, routes
routes = Rails.application.routes.url_helpers routes.payments_url(10)