Colin Law wrote:
before changing the db the application was working fine..
so wat would be problem in my database or something...where i have to
lookup
Kindly Provide Me Your Views for my issue..
Please post the code which attempts to update the record.
If you are using update_attributes what return value is it giving.
Is it possible that you have validations that are failing?
Colin
Thank You for the Reply.
Kindly find my code below
if request.post? and params[ :id ] and params[ :newsinfo ]
@newsinfo = News.find(params[:id])
sql = "UPDATE news SET newstext = 'today' "
@check = ActiveRecord::Base.connection.execute(sql)
if @newsinfo.update_attributes(params[:newsinfo])
flash[:notice] = "news has been successfully modified, click 'edit'
to modify and 'remove' to delete flash news"
redirect_to :controller => 'news', :action => 'list'
else
puts @newsinfo.errors.inspect
end
end
sql = "UPDATE news SET newstext = 'today' "
@check = ActiveRecord::Base.connection.execute(sql)
this code updates the db
but the below code not works still no errors
if @newsinfo.update_attributes(params[:newsinfo])
flash[:notice] = "news has been successfully modified, click 'edit'
to modify and 'remove' to delete flash news"
redirect_to :controller => 'news', :action => 'list'
else
puts @newsinfo.errors.inspect
end
the control goes to if condition only.no validation errors
Any suggestion on this.
Thanks for information
Have a Pleasent daY