title: Calling a Rake task from a controller with parameters
body: <p>I have a instance variable in my controller that queries my table for a value, and I need to send that value through to my rake task. </p>
  
  <p>So here are the 2 relevant lines in my controller:</p>
  
  <pre><code> @turl = Fteam.where(:id =&gt; @ids).select(:TeamUrl)
  system "rake updateTm:update[@turl]"
  </code></pre>
  
  <p>Here is my rake file:</p>
  
  <pre><code>desc "Import Players"
    task :update, [:Tmurl] =&gt; :environment do |t, args|
  
  require 'rubygems'
  require 'nokogiri'
  require 'open-uri'
  require 'mechanize'
  
  agent = Mechanize.new
  
  puts "This is the selected Team URL: #{args.Tmurl}"
    end
  end
  </code></pre>
  
  <p>This is what the rake task returns: </p>
  
  <pre><code>This is the selected Team URL: @turl
  </code></pre>
  
  <p>My guess is that the controller is not passing the variable correctly. So how can I pass the actual value of the variable to the rake task so the output is correct?</p>