You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ArgumentError - When assigning attributes, you must pass a hash as an argument.:
activerecord (4.1.0) lib/active_record/attribute_assignment.rb:16:in `assign_attributes'
activerecord (4.1.0) lib/active_record/persistence.rb:231:in `block in update'
activerecord (4.1.0) lib/active_record/transactions.rb:329:in `block in with_transaction_returning_status'
activerecord (4.1.0) lib/active_record/connection_adapters/abstract/database_statements.rb:211:in `block in transaction'
activerecord (4.1.0) lib/active_record/connection_adapters/abstract/database_statements.rb:219:in `within_new_transaction'
activerecord (4.1.0) lib/active_record/connection_adapters/abstract/database_statements.rb:211:in `transaction'
activerecord (4.1.0) lib/active_record/transactions.rb:208:in `transaction'
activerecord (4.1.0) lib/active_record/transactions.rb:326:in `with_transaction_returning_status'
activerecord (4.1.0) lib/active_record/persistence.rb:230:in `update'
inherited_resources (1.4.1) lib/inherited_resources/base_helpers.rb:85:in `update_resource'
inherited_resources (1.4.1) lib/inherited_resources/actions.rb:45:in `update'
app/controllers/posts_controller.rb:21:in `update'
My controller:
class PostsController < InheritedResources::Base
#...
def update
update! do |format|
format.html { render :index }
format.json { respond_with_bip(@post) }
end
end
#...
end
I tracked it down to this code:
def update_resource(object, attributes)
object.update_attributes(*attributes)
end
If I remove the star object.update_attributes(attributes) everything is fine. I don't understand what's wrong here? Is this a bug? Am I using it wrong?
Anyone else getting this?
The text was updated successfully, but these errors were encountered:
On resource update I get this:
My controller:
I tracked it down to this code:
If I remove the star
object.update_attributes(attributes)
everything is fine. I don't understand what's wrong here? Is this a bug? Am I using it wrong?Anyone else getting this?
The text was updated successfully, but these errors were encountered: