Note that there are some explanatory texts on larger screens.

plurals
  1. POArgumentError in controller
    text
    copied!<p>I'm making edit object form with Angularjs and Ruby on Rails 4 is my backend. I got following error and don't see proper way to debug it:</p> <pre><code>Started PUT "/albums/52109834e9c88c3292000001" for 127.0.0.1 at 2013-08-24 17:24:37 +0400 Overwriting existing field email. Processing by AlbumsController#update as JSON Parameters: {"_id"=&gt;{}, "title"=&gt;"Sacred Circuits"} MOPED: 127.0.0.1:27017 QUERY database=aggregator_front_development collection=users selector={"$query"=&gt;{"_id"=&gt;"520bd6cbe9c88ca789000001"}, "$orderby"=&gt;{:_id=&gt;1}} flags=[:slave_ok] limit=-1 skip=0 batch_size=nil fields=nil (0.7932ms) Completed 500 Internal Server Error in 63ms ArgumentError (wrong number of arguments (2 for 0..1)): app/controllers/albums_controller.rb:18:in `update' </code></pre> <p>Line 18 is update function, which has no arguments. I'm sending object from Angularjs form to update it. <strong>albums_controller.rb:</strong> </p> <pre><code>class AlbumsController &lt; ApplicationController respond_to :json, :js def index respond_with Album.all end def show respond_with Album.find(params[:id]) end def create respond_with Album.create(params[:album]) end def update respond_with Album.update(params[:id],params[:album]) end def destroy respond_with Album.destroy(params[:id]) end private def album_params params.require(:album).permit(:title) end end </code></pre> <p>I understand, that ArgumentError (wrong number of arguments (2 for 0..1)) means, but don't know where to look for real arguments send. How to debug this situation?</p>
 

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