Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eliotsykes/rails-console-cheatsheet
Rails console cheatsheet :memo: :relaxed:
https://github.com/eliotsykes/rails-console-cheatsheet
cheatsheet rails rails-cheat-sheet rails-console ruby-on-rails
Last synced: 5 days ago
JSON representation
Rails console cheatsheet :memo: :relaxed:
- Host: GitHub
- URL: https://github.com/eliotsykes/rails-console-cheatsheet
- Owner: eliotsykes
- Created: 2018-10-27T07:30:17.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2020-07-26T10:28:35.000Z (over 4 years ago)
- Last Synced: 2024-12-18T16:27:17.335Z (23 days ago)
- Topics: cheatsheet, rails, rails-cheat-sheet, rails-console, ruby-on-rails
- Homepage:
- Size: 1000 Bytes
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Rails Console Cheatsheet
- `rails c` starts console
- `rails db` starts db client## `*_path` & `*_url` Route Helpers
- `app.root_path` and `app.root_url`
- `app.invoice_path` and `app.invoice_url`
- `app.engine_name.some_path` and `app.engine_name.some_url`
- `show-routes`, `show-routes -G invoice`, `help show-routes` (requires [pry-rails gem](https://github.com/rweng/pry-rails))## ActiveRecord
- `#to_sql` outputs query, e.g. `Account.where(created_at: 1.week.ago..Time.current).to_sql`
- `show-model Account` (requires [pry-rails gem](https://github.com/rweng/pry-rails))## Pry
- Type `help`