# Persisting Controller Class Attributes

**URL:** <https://www.ruby-forum.com/t/persisting-controller-class-attributes/115354>\
**Category:** Rails\
**Created:** [September 24, 2007, 10:55am UTC](https://www.ruby-forum.com/t/persisting-controller-class-attributes/115354 "2007-09-24T10:55:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnlester](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e480ec/32.png) [@johnlester](https://www.ruby-forum.com/u/johnlester)\
**Post date:** [September 24, 2007, 10:55am UTC](https://www.ruby-forum.com/t/persisting-controller-class-attributes/115354/1 "2007-09-24T10:55:09Z")

</div>

Hi, this is probably a silly question but I’ll ask it anyway becasuse  
Ruby/Rails tends to have an answer for everything!

I have a controller that has a number of configuration parameters in  
class variables that control its behaviour.

Currently changing these requires editing the code. I’d like to provide  
a view that allows them to be changed but I then have the problem of  
persisting them.

Yes, I know I can write an attributes model to store them in (and I  
think this may be the correct way to do this), but…

Is there a way (perhaps a plugin, module or helper) that allows certain  
class variables in a controller or other class to be persisted in the  
database without having to go to the trouble of writing a model myself ?
