Hi!
Im validating name field in “dev” model by checking its uniqueness. but
while editing that particular entry, the system again validates for
uniqueness of name. so if i dnt change name while editing , it gives me
error: name has already been taken.
my update code is :
- def updateDevice
-
@device=Dev.find(params[:id])
-
@devtype=Devtype.find_by_id(params[:device][:devtype_id])
-
if request.post?
-
@device.update_attributes!(params[:device])
-
redirect_to :action=>"showDevices_admin"
-
end
-
end
what is the problem exactly??
Thanx in advance!
sups
View this message in context:
http://www.nabble.com/validating_uniqueness_of-creating-problem-while-updating-tp18231473p18231473.html
Sent from the RubyOnRails Users mailing list archive at Nabble.com.