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.
raj ma (Guest)
on 2007-05-25 00: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
Jean-Etienne D. (Guest)
on 2007-05-25 20: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.