2010/1/25 adedip <[email protected]>:
> Hi everybody.. I'm stuck with a strange (stupid) problem I can't
> understand.
>
> I'm trying to do this in the articles_controller:
>
> def updatecollection
>   �...@arts = Article.find_by_solr("14 MAY 91").results
>
>   �[email protected] do |doc|
>     �...@sub = doc.title[15,150]
>       # Updating one record:
>       doc.title = @sub
>      doc.save

Test the return value from save here to see if it succeeded.  Perhaps
it is failing validation.

Colin

>
>    end
> end
>
> It loads but i doesn't update the article..the strange fact is that if
> I do the same process for a single doc in the console it works.. so
> what's wrong? something in the .each do?
> thanks!
>
> (any different solution it's fine for me ;) )
>
> --
> 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.
>
>

-- 
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