Say for example,
begin @user = User.find(params[:id]) rescue ActiveRecord::RecordNotFound flash[:notice] = "#No such record in User for id :: {params[:id]} on #{action_name}" end
UPDATE
flash[:notice] = t('flash.recordnotfound',:class_name => self.class.name, :column_name => params[:id], :action_name => action_name)
Now in your config/locales/en.yml (this would help translate, refer to i18n here)
flash: recordnotfound: "Sorry, no record od %{column_name} in class %{class_name} was found on you action %{action_name}"
If you do not want to use locales just put up this information in flash[:notice] itself.
More dynamic ?
Write a function and use the same flash [:notice] there. Wont hurt at all.
want more data ?
Heres a quick solution, i always <%= params%> in my views to know easily whats going and whats coming. You can then open your rails console and play along with different actions and so on.
user = User.new user.save user.errors.messages
All of this is good enough data, i think.
Good luck.
ActiveRecord::RecordNotFoundinstances carry along zero information with it (class RecordNotFound < ActiveRecordError; end, end of the story).