whyi / gallery

An open source, single page art gallery app written in Ruby on Rails and Angular.js
2 stars 0 forks source link

ActiveModel::ForbiddenAttributesError in ArtsController#update #62

Closed whyi closed 9 years ago

whyi commented 9 years ago

ActiveModel::ForbiddenAttributesError in ArtsController#update ActiveModel::ForbiddenAttributesError

Extracted source (around line #20): 18 19 20 21 22 23

def self.update(params) @art = Art.find(params[:id]) $redis.set("arts", Art.all.to_json) if @art.update_attributes(params) end

def self.destroy(id)

Rails.root: c:/gallery

Application Trace | Framework Trace | Full Trace app/services/arts_service.rb:20:in update' app/controllers/arts_controller.rb:21:inupdate' Request

Parameters:

{"utf8"=>"✓", "_method"=>"patch", "authenticity_token"=>"UeiBZDDQk+a0hfpD639C1dSiTHgW+yBAi/pMQ9obnfM=", "art"=>{"title"=>"dddddddddddddddddddddddddddddd", "description"=>"ddddddddddddddddddddddd", "medium"=>"ddddddddddddddddddddddddddd", "category_cd"=>"1", "width"=>"10", "height"=>"10", "year"=>"2010", "filename"=>#<ActionDispatch::Http::UploadedFile:0x37cfba8 @tempfile=#<Tempfile:C:/TEMP/RackMultipart20141118-12748-10ox21a>, @original_filename="P3190386.png", @content_type="image/png", @headers="Content-Disposition: form-data; name=\"art[filename]\"; filename=\"P3190386.png\"\r\nContent-Type: image/png\r\n">}, "commit"=>"Update", "id"=>"2"} Toggle session dump Toggle env dump Response

Headers:

None

whyi commented 9 years ago

Seems like some params have gotten out from the allowed parameters... just my hunch. UGH!

whyi commented 9 years ago

Done!