Colin Law wrote:
> 2009/11/11 Newb Newb <[email protected]>:
>> 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
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to