I am doing a web shop assignment and have got a problem with my action
mailer.

I get an error undefined local variable or method 'game'

I have the following in my mailer:

  def game_interest(user, game)
    @user = user
    @game = Game
    mail :to => user.email, :subject => "Game Interest"
  end

and the following in my controller:

  def email

      @game = Game.find(params[:id])
        respond_to do |format|
        user = @game.user
         email = user.email
          g = GameTrade.game_interest(user, game)
           g.deliver
      format.html { redirect_to root_url }
      format.json { render json: @game }
    end
  end

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to