ruby on rails - ApplicationController Method with Equal Sign -


in rails 4 i'm trying this:

class applicationcontroller < actioncontroller::base   # not work   def x=(value)     session[:x] = value   end    # have instead   def set_x(value)     session[:x] = value   end   end 

when try call x = 1 child controller, don't error, session variable doesn't set. running set_x 1 works expected though.

i think problem of scope, instead of calling x = 1, try call self.x = 1.


Comments

Popular posts from this blog

rest - Spring boot: Request method 'PUT' not supported -

php - Magento - Deleted Base url key -

symfony - imagine_filter() not generating the correct url in LiipImagineBundle -