ruby on rails - Can I replace class variables with class instance variables in Simple Form gem? -


For stylish reasons, I would like to avoid using class variables and would like to change them with a class instance variables. So if I have:

  module SimpleForm mattr_accessor: input_error_class @@ input_error_class = 'error-field' ... end   

and I change it in I: Module SimpleForm @input_error_class = 'Error Field' Category & lt; & Lt; Self attr_accessor: input_error_class end ... end

Will this break a simple form?

If there is a class that is a sub-class or SimpleForm Superclass, then the shared code is @@ input_error_class , then by changing the class instance to the class instance variable, the variable will no longer be shared by sub / superclass, and it can break the code Also, If there is an example method that uses class variables, which can break the code. Otherwise, it does not break.

Comments

Popular posts from this blog

c - Performance of System() -

python - how we can use ajax() in views.py in django? -

wpf - ControlTemplate with changes for every class -