Displaying 5 results from an estimated 5 matches for "import_str".
Did you mean:
port_str
2006 Jul 24
2
Newbie error message!
hello you all,
I''m new with Ruby on Rails. I''m developing an application. I got the
follwoign erro, can anybody give a hand?
ArgumentError in AdminController#import_strings
wrong number of arguments (0 for 1)
RAILS_ROOT: ./script/../config/..
Request
Parameters: {"commit"=>"Import",
"description"=>{"description"=>#<StringIO:0x36311f0>},
"variable"=>["English"]}
Show session dump
---...
2006 Jul 25
1
newbie--how do i load a parsed file?
...w with ruby on rails and i don''t know how to load up a parsed file
into my database. I have my ruby script that parses it but don''t know
where to put my code, or how to combine it with view/model/controller.
this is what i have:
class Description < ActiveRecord::Base
def import_strings(a_file)
table = { }
IO.foreach(''#{a_file}'') { |line|
if line =~ /^ \s* " (.*?) " \s* = \s* " (.*?) "/x
table[ $1 ] = $2
end
}
description = Description.new
description.Lenguage = [$1]
description.Platform = [$2]
description.save...
2006 Jul 28
0
newbie----what''s wrong with my code
...multipart => true)%>
<p>
<b>Lenguage:</b><br/>
<%= select("variable", nil, @array_of_lenguages) %>
</p>
<p>
<b>Path: </b><br />
<%= file_field ("string_record", "import_strings" )%>
</p>
<p><%= submit_tag "Import"%></p>
<%= end_form_tag%>
my save method in my controller:
def save
@string_record = StringRecord.new(params[:string_record])
if @string_record.save
redirect_to(:action=>''show'',...
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
2006 Jul 31
10
nothing uploads.....why? (newbie question)
...<p>
<b>Path: </b><br />
<%= file_field ("StringRecord", "" )%>
</p>
<p><%= submit_tag "Import"%></p>
<%= end_form_tag%>
model:
class StringRecord < ActiveRecord::Base
def import_strings(a_file)
table = { }
IO.foreach(''#{a_file}'') { |line|
if line =~ /^ \s* " (.*?) " \s* = \s* " (.*?) "/x
table[ $1 ] = $2
end
table.each do |key, value|
StringRecord.create(:key => key, :value => value)
end
}...