Displaying 2 results from an estimated 2 matches for "eabh".
Did you mean:
abh
2006 Jul 28
0
newbie----what''s wrong with my code
...is is my active record class:
class StringRecord < ActiveRecord::Base
def import_strings
table = { }
IO.foreach(''Localizable.strings'') { |line|
if line =~ /^ \s* " (.*?) " \s* = \s* " (.*?) "/x
table[ $1 ] = $2
end
table.eabh do |key, value|
string_record.create(:key => $1, :value => $2)
end
}
end
end
Can anybody help me out by guiding me in the right direction?
Any help will be highly appreciated.
rich
--
Posted via http://www.ruby-forum.com/.
2006 Jul 27
7
Newbie question---
I wrote a ruby script that parses a file into key-values like so:
class Parser
table = { }
IO.foreach(''Localizable.strings'') { |line|
if line =~ /^ \s* " (.*?) " \s* = \s* " (.*?) "/x
table[ $1 ] = $2
end
}
end
I want to store the key-values in different colums on my database so
that when I enter a key, it gives me the corresponding value...how