[Rails] Re: Foreign keys in order to send email
I currently have the following in my games_controller for the show
section so that when a user clicks on the button it does the following
e.g. Jon(user 6) is interested in Adam(user 31) game. Jon clicks on
adams game show page and clicks the interested button. The email should
send to user 31's email address.
Now if I write game.user.email I get undefined method game but the
following states wrong number of arguments (1 of 0).
def show
@game = Game.find(params[:id])
respond_to do |format|
GameTrade.game_interest(@game.user.email).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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home