Greg Hauptmann
2009-Mar-05 07:02 UTC
Dynamic Config Plugin for Rails - recommendations??? (e.g. storing in database)
Wondering if there is an existing plugin/approach for config data that you want your application to be able to change? In other words a value/pair type configuration plugin that persists to the database. Just a normal Model would be OK, however any neat tricks how to handle the fact that each parameter may be a different type? e.g. have a column in the model to hold the type & store value as a string? have a different column for each type but then any given parameter (or row in database terms) would populate only one of the columns? -- Greg http://blog.gregnet.org/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
MaD
2009-Mar-05 08:15 UTC
Re: Dynamic Config Plugin for Rails - recommendations??? (e.g. storing in database)
i don''t know of any plugins, but i did the same thing once for a project of mine. i used your first alternative. my configuration model had only two attributes: "name" and "value". i only saved strings. for config this was sufficient. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Matt Jones
2009-Mar-05 16:27 UTC
Re: Dynamic Config Plugin for Rails - recommendations??? (e.g. storing in database)
I''ve used the rails-settings plugin before - very easy to use, and stores settings as YAML, so they hold whatever datatype you put in. http://github.com/Squeegy/rails-settings/tree/master --Matt Jones On Mar 5, 2:02 am, Greg Hauptmann <greg.hauptmann.r...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Wondering if there is an existing plugin/approach for config data that you > want your application to be able to change? In other words a value/pair > type configuration plugin that persists to the database. > Just a normal Model would be OK, however any neat tricks how to handle the > fact that each parameter may be a different type? e.g. have a column in the > model to hold the type & store value as a string? have a different column > for each type but then any given parameter (or row in database terms) would > populate only one of the columns? > > -- > Greghttp://blog.gregnet.org/--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---