Question

So, I created the following migration:

class AddAclToUsers < ActiveRecord::Migration
  def self.up
    add_column :users, :acl, :integer
  end

  def self.down
    remove_column :users, :acl
  end
end

however, after modifying the various erb files in the view, values entered in edit.html.erb are not saved to the database.

I can manually start SQlite3 and select * the table and see that the column was created but no values are entered. I can also manually UPDATE or INSERT numbers into the new column which the controller queries and displays correctly.

Any suggestions on what may be wrong with the frameworks udate/save??

-daniel

Was it helpful?

Solution

Please check if there is a list of attr_accessible in your User model. If you are using Devise like gem/plugin for authentication you would have a list of attr_accessible in the model.

Add new attribute (acl in your case) to the attr_accessible list.

If this is not the case, I would like you to paste your view, controller and model code

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top