ruby on rails - Backbone application: storing user settings -
i have been working on rails/backbone application. until now, time user made specific changes application (e.g. chose 1 view on others, used filters, customized info presented in view), store his/her choices rails session variables. using info these session variables ensured user's changes persist when page refreshes or when new instances of application used on same computer. case until user signs out, leads loss of session variables' info , default settings next time user logs in.
the received feedback users want changes persist if log out or if utilize different computers (e.g. default settings should replaced changes, long same user logged in). how should implement feature?
thank you!
agreed mischa, should save datas in database.
this exemple how simple add together preferences user:
class user < activerecord::base serialize :preferences end u = user.new u.preferences = { :view => {:controller => :dasboard, :action => :index}, :filters => { :users => { :order => :email :page => 1 :quantity_per_page => 20 } } }
make sure field's type in database "text"
ruby-on-rails ruby-on-rails-3 backbone.js
No comments:
Post a Comment