Note that there are some explanatory texts on larger screens.

plurals
  1. POCouldn't find "Object" with ID = ActiveRecord::RecordNotFound
    primarykey
    data
    text
    <p>Every time i delete or destroy a Product it aways give me this error in my console:</p> <pre><code>ActiveRecord::RecordNotFound (Couldn't find Product with ID=4): app/controllers/products_controller.rb:16:in `show' </code></pre> <p>and on the page it gives:</p> <pre><code>ActiveRecord::RecordNotFound in ProductsController#show Couldn't find Product with ID=4 </code></pre> <p>In my Products Controller i just have the regular scaffold:</p> <pre><code>def show @product = Product.find(params[:id]) respond_to do |format| format.html # show.html.erb format.xml { render :xml =&gt; @product } end end def destroy @product = current_user.products.find(params[:id]) #current user deletes own @product.destroy respond_to do |format| format.html { redirect_to(products_url) } format.xml { head :ok } end end </code></pre> <p>I am using Rails Jquery UJS and rails-jquery and have the <code>csrf_meta_tag</code>in my app layout. What i have noticed is when i click the destroy link and it pops up the window and says "Are you Sure", i click the OK button and it flickers TWICE for some strange reason, it never did this until i installed Jquery. How do i fix this?</p> <p><strong>EDIT - ANSWER:</strong></p> <p>Reinstall rails jquery-ujs > <a href="https://github.com/rails/jquery-ujs" rel="nofollow">https://github.com/rails/jquery-ujs</a></p> <p>You have to keep both files <code>jquery.min.js</code> and <code>jquery.js</code>. I deleted the jquery.min.js because i thought it was a minimized version but apparently not, here are all of my files from jquery-ujs:</p> <pre><code> jquery.js jquery.min.js jquery_ujs.js rails.js # i had to install this manually from the link (or zip file) jquery-ui # i wanted the user interface too </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload