Skip to content

Instantly share code, notes, and snippets.

@ArunGupta25
Created October 16, 2013 01:00
Show Gist options
  • Save ArunGupta25/7001064 to your computer and use it in GitHub Desktop.
Save ArunGupta25/7001064 to your computer and use it in GitHub Desktop.
rails error, private method
NoMethodError in ListingsController#update
private method `update' called for #<Listing:0x007fc33f857e60>
Rails.root: /Users/arungupta/sartorialis
Application Trace | Framework Trace | Full Trace
app/controllers/listings_controller.rb:46:in `block in update'
app/controllers/listings_controller.rb:45:in `update'
Request
Parameters:
{"utf8"=>"✓",
"_method"=>"put",
"authenticity_token"=>"Wt3byGW/oZM4ul8UlldtwTn28kZdP8sS+3lxqdAtUt8=",
"listing"=>{"user_id"=>"1",
"category"=>"raw denim",
"title"=>"Petit New Standard",
"designer"=>"APC",
"size"=>"31",
"price"=>"180.0",
"paypal_id"=>"[email protected]",
"description"=>"Jeans from A.P.C. Raw denim crafted from cotton. Selvage. Cut slightly narrower than the classic New Standard model. Narrow leg,
slightly fitted at bottom to give the appearance of a straight leg. Neither low nor high rise. Button fly. Wear one size down since they will move up with use.\r\n\r\n–Indigo\r\n–100% Cotton\r\n–Model is 189 cm and wears size 31",
"photos_attributes"=>{"0"=>{"remote_image_url"=>""}}},
"id"=>"64"}
Show session dump
Show env dump
Response
Headers:
None
def update
@listing = Listing.find_by_id(params[:id])
respond_to do |format|
if @listing.update(params[:listing])
format.html { redirect_to @listing }
else
format.html { render action: 'edit' }
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment