Hello, I have a number of models that each require some static key/value pairs to perform calculations. I envision an external file for each model named the same as the model that the model can open and parse when needed. I liken this external file to the .plist files that apple apps have. Q1. Does this make sense? Is there an easy way to do this? Q2. Does Rails have a .plist equivalent or something similar? Q3. Does Rails have built in parsing functionality that can make this easy (say xml or yaml)? Many thanks, Ryan Glover -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Ryan Glover wrote:> I have a number of models that each require some static key/value pairs > to perform calculations. I envision an external file for each model > named the same as the model that the model can open and parse when > needed. > > I liken this external file to the .plist files that apple apps have. > > Q1. Does this make sense? Is there an easy way to do this? > > Q2. Does Rails have a .plist equivalent or something similar? > > Q3. Does Rails have built in parsing functionality that can make this > easy (say xml or yaml)?YAML works great and Rails uses it for stuff like your database.yml config file. You can just do something like: filedata = YAML::load_file(path_to_file) -- Michael Wang --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---