Hi, I have a problem passing two values through link_to. I have the following code in my view . . . <%link_to "reply", {:action => :reply, :id => @topic.id, :reply_to => @reply.id}%> . . . In my controller I try to find the @topic and @reply_to by using the :id and :reply_to values. However, when I commit post the @reply_to object becomes null. If I change the name of the variable :reply_to in my view to :id (and the :id to :topic) it works fine but then the @topic will be null. Any idea why? any help will be greatly appreciated. def reply @topic = Topic.find_by_id(params[:id]) @reply_to = Reply.find_by_id(params[:reply_to]) @reply = Reply.new(params[:reply]) @reply.topic = @topic @reply.reply_to_id = @reply_to.id if request.post? if params[:commit] == "Cancel" flash[:notice] = "Cancelled" redirect_to(params[:referer] || :back) elsif params[:commit] == "Post" if @reply.save flash[:notice] = "Successful post" redirect_to (params[:referer] || :back) end end end end Many thanks, Andy -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---