Important note. Database extensions and index creation (at least for Postgres ones like those used in this episode) are supported since Rails 4 so there should be no need to switch to structure.sql as advised in this episode anymore.
Don't use model.image.to_s but instead model.image.url
Using to_s breaks the default_url override if you want to use a default image when none exists.
This guy:
ruby
# Provide a default URL as a default if there hasn't been a file uploaded:defdefault_url"/images/fallback/" + [version_name, "default.png"].compact.join('_')
end
Important note. Database extensions and index creation (at least for Postgres ones like those used in this episode) are supported since Rails 4 so there should be no need to switch to
structure.sql
as advised in this episode anymore.See this Pull Request merged over a year ago.
Don't use
model.image.to_s
but insteadmodel.image.url
Using to_s breaks the default_url override if you want to use a default image when none exists.
This guy: