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 - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -