elioncho
2010-Jul-28 05:45 UTC
Problem loading YAML files and using pluralize method in Rails3rc
Hi, I just upgraded my rails app from rails3.0.0beta4 to rails3.0.0rc and I''m having problems loading a yaml file. I have a load_config.rb in the initializers folder which loads a yaml file. The basic loading code is: FACEBOOK_CONFIG = YAML.load_file(File.join(Rails.root, ''config'', ''facebooker.yml''))[RAILS_ENV] This stopped working when I moved to rails3rc. FACEBOOK_CONFIG returns nil. Also, I have a pluralize method in one of my views, which worked right before: <%= pluralize(post.comments.size, ''comment'') %> Now, I''m getting a: uninitialized constant Post::Comment Can anyone help me sort these two problems? -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
elioncho
2010-Jul-28 05:51 UTC
Re: Problem loading YAML files and using pluralize method in Rails3rc
I figured out the solution for the YAML problem. RAILS_ENV has changed to Rails.env. I changed it and it work. I still have problems with the pluralize method though. Any help is appreciated On Jul 28, 12:45 am, elioncho <elion...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > I just upgraded my rails app from rails3.0.0beta4 to rails3.0.0rc and > I''m having problems loading a yaml file. I have a load_config.rb in > the initializers folder which loads a yaml file. The basic loading > code is: > > FACEBOOK_CONFIG = YAML.load_file(File.join(Rails.root, ''config'', > ''facebooker.yml''))[RAILS_ENV] > > This stopped working when I moved to rails3rc. FACEBOOK_CONFIG returns > nil. > > Also, I have a pluralize method in one of my views, which worked right > before: > > <%= pluralize(post.comments.size, ''comment'') %> > > Now, I''m getting a: > > uninitialized constant Post::Comment > > Can anyone help me sort these two problems?-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.