Skip to content

Today I learnt...

Eric Ackermann edited this page Dec 20, 2019 · 5 revisions

Share your new knowledge about Ruby, Rails or other good to know things for development with the crowd

22.11.19

How to Completely reload the db schema: (bundle exec) rails db:migrate VERSION=0 (RAILS_ENV=test/development) && rails db:migrate (RAILS_ENV=test/development)

24.11.19

When you encounter translations missing: Go to config >> locales. The start of the error message will reveal which file you'll have to edit. Add a nested path to the one you get complaints about, e.g.: translation missing: en.users.registrations.edit.update will require you to add / edit in users.en.yml
en:

users:

registrations:

edit:

update: "Update"

24.11.19

The certain t('sth') you can find in views are part of I18n and look up a translated text with the corresponding name in config >> locales

05.12.19

When the db migration fails in ruby with something mentioned like "method does not exist for nil class" rails db:reset helps by migrating everything from the start.

20.12.19

You can get access to heroku postgres like this:

heroku run "ruby ./bin/rails dbconsole" -a hpi-lectureportal-dev