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 will 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 enter this information in flash[:notice] .
More dynamic?
Write a function and use the same flash [: notice]. It will not hurt at all.
Want more data?
This is a quick fix, I always <%= params%> in my views to easily find out what is happening and what will happen. Then you can open the rail console and play along with various actions, etc.
user = User.new user.save user.errors.messages
All this is pretty good data, I think.
Good luck.
source share