title: Using devise method 'current_user' in mailer
body: <p>am relatively new to rails,i have been working with devise authentication gem for a while now,but my problem is,my app sends an email,with the firstname and lastname of the current user after a form is filled,but each time i try to send the email with the above stated parameters i get an error that says "undefined method current_user"
  my mailer looks like this,note:its a separate controller that controls it.</p>
  
  <pre><code>&lt;table&gt;
  &lt;tr&gt;
  &lt;td&gt;name&lt;/td&gt;&lt;td&gt;&lt;%= current_user.firstname %&gt;&lt;%=current_user.firstname  %&gt;&lt;/td&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>&lt;tr&gt;
  
          &lt;td&gt;phone no.&lt;/td&gt;&lt;td&gt;&lt;%= current_user.phone %&gt;&lt;/td&gt;
  
      &lt;/tr&gt;
  
      &lt;tr&gt;
  
          &lt;td&gt;location&lt;/td&gt;&lt;td&gt;&lt;%= @device.location %&gt;&lt;/td&gt;
  
      &lt;/tr&gt;
  
      &lt;tr&gt;
  
          &lt;td&gt;device type&lt;/td&gt;&lt;td&gt;&lt;%= @device.device_type %&gt;&lt;/td&gt;
  
      &lt;/tr&gt;
  
      &lt;tr&gt;
  
          &lt;td&gt;brand&lt;/td&gt;&lt;td&gt;&lt;%= @device.brand %&gt;&lt;/td&gt;
  
      &lt;/tr&gt;
  
  &lt;/table&gt;
  </code></pre>
  
  <p></p>
  
  <p>my controller action is this</p>
  
  <pre><code>def create
  
      @user=current_user
  
      @device = Device.new(device_params)
  
          if @device.save
  
              DeviceMailer.send_device.deliver
  
              flash[:notice] = 'Request sent successfully,you will be
  </code></pre>
  
  <p>contacted shortly'
              else
                  flash[:error] ='Request not sent,check details and sendagain'
                  render 'new'
              end</p>
  
  <pre><code>end
  </code></pre>