/ Published in: Rails
                    
                                        
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
 def add book = Book.find(params[:id]) or raise ActiveRecord::RecordNotFound # Added by sending book object. flash[:cart_notice] = "'#{book.title}' was added!" if @cart.add book redirect_to :action => 'index' end
Comments
                    Subscribe to comments
                
                