similar to: Problem loading YAML files and using pluralize method in Rails3rc

Displaying 20 results from an estimated 400 matches similar to: "Problem loading YAML files and using pluralize method in Rails3rc"

2008 Mar 20
2
Anyone having problems with asset_host not getting set up right?
Hey All, I think I found a bug but I would be suprised since it would cause major problems. We setup the asset_host in init.rb with: if File.exist?(facebook_config) FACEBOOKER = YAML.load_file(facebook_config)[RAILS_ENV] ENV[''FACEBOOK_API_KEY''] = FACEBOOKER[''api_key''] ENV[''FACEBOOK_SECRET_KEY''] =
2008 Oct 08
1
Memory leak problem
I have a txt file with some data that i need to import to de database. I''m using ruby to import those data but i have a major problem, when i ''ve a large amount of data i run out of memory. File.open("#{RAILS_ROOT}/public/files/Neighborsville.TXT").each() do |line| @stringArray = line.split("|") @i += 1 puts @i @pid =
2010 Jul 27
4
Ruby on Rails 3 RC and files in "lib" directory
In Rails 3b4 my ruby files in the lib directory of my application were automaticaly loaded/required. In Rails 3rc1, there are not anymore. Is this normal? Where is the commit that changed this? What is the best prefered way to load the files in "lib"? Thanks for your answers. Nicolas. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed
2006 Sep 05
1
Inflector::pluralize("Agencies")=="Agency" ?
The result of Inflector::pluralize("Agency") is correctly "Agencies", but pluralize again and it goes back to the singular ? Is this as expected ? Also, I have a need to know if a word is singular or plural, and to convert it to one or the other regardless of it already being so. Anyway, I''ve written these which seem to work. Do they already exist somewhere ? def
2007 Jan 20
2
Conditional pluralize without the number
Hi. Assume you have an array of person names. I want to generate results in my view that look like this: Abby is your friend or Abby, Bob, and Carol are your friends. So I''d like to say: <%= friends.to_sentence %> <%= pluralize(friends.count, "is") %> your <%= pluralize(friends.count, "friend") %> But because pluralize puts in the
2006 Feb 11
1
Singularize and Pluralize of the word Faculty
I am have problems with one of my model''s call Faculty... my models name is Faculty so the database should be called faculties right? Has there been documented problems with words ending in ''y''? Thanks for your help. John Kopanas http://www.kopanas.com ===================================================================== http://www.soen.info - source of the
2006 Feb 13
5
Acts_as_taggable pluralize
I am implementing a messaging system, which requires broadcast to group feature. Instead of a relatively clunky habtm group structure, I am using tags. Form a usability standpoint, it would be helpful to avoid redundant tags. Like, friend vs friends OR client vs. clients. Is it practical to filter tags, before entry, to avoid duplicate tags like plural vs. singular? -- Posted via
2007 Jan 18
8
How can I find out which attribute is screwing up pluralize/singularize?
Hey there :) I''m creating this app on top of a legacy database, that has a mixture of auto_inc ids, non-''id'' named pks, non-integer-pks, foreign keys that end in _code instead of _id, etc. I have the model working great in the console, where I can create any modeled object and reference other objects without issues. However, I''m running into problems with
2008 Sep 19
1
Help with best approach(fairly easy question)
Hello! Well this is maybe a fairly easy question. I am writing an app where users that belong to a group have their own blog where they can make posts. I have a posts_controller with all the CRUD operations and my index action shows all the posts from all the users on a group. The route is: users/1/posts The thing is that I want to show too, all the posts from any user, or all the posts for a
2006 Apr 12
1
pluralization issue? (taxes/taxis)
Hi all, Here''s an odd one. I have a "Tax" model which is related via a habtm relationship to a "Storefront" model. In my view_store rhtml file, I have the line : @storefront.taxes.each do |tax| This line returns the following error: NameError in Admin#view_store Showing app/views/admin/view_store.rhtml where line #52 raised: uninitialized constant Taxis See
2006 Jan 19
4
Using RoR pluralization rules
Hello, RoR seems to be aware of plurals like category=>categories etc..I Want to be able to use this in my application to relate some keywords.Is it possible ?or does RoR itself use some ruby library? Thanks Vivek -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060119/d5660663/attachment.html
2006 May 18
1
mime yaml
First off, apologies if this is addressed.. I didn''t find anyone having the same problem (which usually means the problem is me!) I''m running the standard command to start a Rails server, with additional custom mime YAML: mongrel_rails start -m /etc/mongrel_mime.yml Content of the /etc/mongrel_mime.yml is only a single line: .xml: text/xml However, the custom mime
2007 Apr 12
0
dumping data to yaml in specs
I''m wondering whether I could dump out an object to yaml if a certain spec fails. I believe you can do this sort of thing in test unit. E.g.: hash_one.should == hash_two if_failed? hash_two.to_yaml Scott
2006 Aug 03
1
Is it possible to interpolating variables in YAML files?
I''m attempting to store a value that''s dependent on an environment variable in a custom .yml file, like so: job_folder: "#{RAILS_ROOT}/jobs" Doesn''t seem to like that. Is there any way for me to have access to the RAILS_ROOT environment variable from inside of my configuration file? Thanks, Wes -- Posted via http://www.ruby-forum.com/.
2006 Jul 24
0
HTML YAML Builder
Is anyone interested in a YAML Builder for HTML? Some trivial YAML that could be converted to HTML: html: - head: - title: My title - body: - p: - {!id: someId, !class: class1 class2} - Hello - img: {!src: someurl.gif} - hr: - ul: [{!id: someId}, {li: hello}, {li: goodbye}] - ul: - {!style: "height: 30px"} - li: [{!id: first}, First] -
2006 May 02
0
YAML failing to de-serialize
I''m seeing this same problem that Josh was seeing back on March 23rd (see below) I''ve got the following YAML snippet stored in a text field: "--- !ruby/object:FieldValue \nattributes: \n item_id: 60\n title: Test\n field_id: 15\n created_by_id: 5\n locale: en\n link: www.cclearn.com\n comment: this is a test\n created_at: 2006-05-02 15:43:14.256792 Z\nnew_record:
2006 Apr 09
0
action cache plugin, bad yaml?
Is there anyone out there using this plugin in production: http://wiki.rubyonrails.com/rails/pages/Action+Cache+Update+Plugin it seems to occasionally generate bad YAML, which makes the cached page unavailable. Here is what happens when I try to parse it from the console: >> YAML.load open(''tmp/philly.localfeeds.com/.cache'') ArgumentError: syntax error on line 318,
2007 Feb 09
1
Gracefully recovering from state.yaml corruption.
Hello, I have recently attempted to automatically restart my network interfaces when I update my network configuration files. During this process it seems that one out of every three or so runs will cause the state.yaml file to become corrupt. The next run of puppet will respond with messages similar to "can''t find object :nil". Deleting the state.yaml file and running
2007 Apr 03
1
metainfo.yaml
Can there be multiple metainfo.yaml files in different directories? I can''t find any indication in the docs, and I''m upgrading an old project based on webgen 0.3.8 which has this sort of setup. By the way, to parse my own inline html with textile I was able to write a content converter quite successfully. Scott
2006 Feb 20
0
YAML and has many associations
Hi, I have the following: order = YAML::load(order_yaml) The YAML contains order_items too, and my order model has a has_many to order_items. When I do order.order_items, I don''t want Rails to go the db to get the order_items, but use the order_items already contained in the object created from the YAML. How would I do this? Thanks Joerg -- Posted via