Git Product home page Git Product logo

Comments (3)

alassek avatar alassek commented on August 15, 2024

Does the $.update command successfully change the data on the server? In that case it sounds like your controller simply isn't configured to return a value after a successful update action.

I'll take a look, but I don't know anything about inherited_resources. You'll need to separate the json and html response code, since html will usually redirect while json should return the updated record.

from jquery.rest.

alassek avatar alassek commented on August 15, 2024

It looks like you want something like this:

class Admin::DesignersController < Admin::BaseController
  respond_to :html, :json

  def update
    update! do |format|
      format.html { redirect_to whatever_path }
      format.json do
        render :json => @designer
      end
    end
  end
end

I'm basing this off of the Overwriting Actions section of the inherited_resources README.

You'll need to fill in a few blanks there, but hopefully that should point you in the right direction. I'm closing this for now since it doesn't sound like an issue with jQuery.rest itself.

from jquery.rest.

SachaG avatar SachaG commented on August 15, 2024

Thanks a lot for your help, that did the trick!

The only reason why I thought it might've been a problem related to jQuery.rest was that I had a "success" response even though it didn't work. But it was not really a javascript problem after all.

from jquery.rest.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.