I’ve seen similar questions here, couldn’t figure out the answer I’m just starting with ror development. I’ve got a rake task :
namespace:generate do
desc "Export to txt"
task :txt => :environment do |t, args|
puts "testing #{args}"
end
end
When I do this from command line:
rake generate:txt
I get testing {}
When I try to inject value as an argument like this :
rake generate:txt[testvalue] or
rake generate:txt testvalue
First one does nothing same output testing {} second one I get an error. So in which way do I invoke command so I populate args with some value(s)?
IIRC, you have to declare parameters explicitly.
Then