object's name field in flash messages

4 views
Skip to first unread message

linpan

unread,
Oct 8, 2009, 6:16:00 PM10/8/09
to resource_controller
I can't seem to figure out how to include my object's name field in my
resource controller flash messages. For example, when updating a
client object, my old controller update method would have a flash
message like so:

flash[:notice] = "The client, <strong>#{@client.name}</strong>,
has been updated."

With resourceful controller, I'd like to do something similar:

update.flash "The client, <strong>#{@client.name}</strong>, was
updated."

... only, using @client throws a nil object error. I've also tried
@object, object, etc., but none of these work. Does anyone know how
to do this?

Elliot
Reply all
Reply to author
Forward
0 new messages