Basically its an argument error.

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

It should be

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

As you are passing the game object to game_interest function,but while
passing it you are using Game class.

-Hari


On Mar 10, 11:50 pm, Roger Patrick <[email protected]> wrote:
> 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 viahttp://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