Forum: Ruby on Rails save error.

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
67654ec62eab59ae168f2c58250d65dd?d=identicon&s=25 raj ma (Guest)
on 2007-05-24 22:31
def show
   @post = Post.find(params[:id])
   @post.increment_count
   if @post.save
      render :action => 'show'
   else
      flash[:notice] = 'Error'
   end
 end


def increment_count
      unless self.count.nil?
        self.count += 1
      else
        self.count = 1
      end
    end

The count is not updated? and it is showing Error (flash notice)
Please help
Eb778b8bb642aa8a82c2b8b63705b6af?d=identicon&s=25 Jean-Etienne Durand (jetienne)
on 2007-05-25 18:54
What' the error message (add error_messages_for :post in your edit
form)?

Jean-Etienne
http://www.woa.hu
This topic is locked and can not be replied to.