I’m struggling with this and I’m not sure if it is obvious or dumb (or
I have a basic create method like so:
@material = Material.new(params[:material])
flash[:notice] = “Material successfully created.”
Ok so far, but now I want to retrieve that object that was just saved so
that it can be used in the view. Something like…
@newmaterial = Material.find(@material.id)
is what I was thinking, but that doesn’t work as @material still has no
The method finishes with a rendering of a table (this is an AJAX called
render_partial ‘listtable’, :layout => false
I want to grab the newly created object so I can hightlight and display
it in the view, but I don’t know how to retrieve it again!
Any and all ideas are most appreciated.