Rails Message This User Button

Posted by bob on Stack Overflow See other posts from Stack Overflow or by bob
Published on 2010-05-02T00:42:58Z Indexed on 2010/05/02 0:47 UTC
Read the original article Hit count: 637

Hello,

I am using this http://github.com/professionalnerd/simple-private-messages plugin in rails and I am on a user page show.html.erb - User and I want to put a button there that, when clicked, goes to the current user's inbox and populates the field call "send to" with the "user" name.

How do I send that data along when the button is clicked?

<%= link_to image_tag('send_message_button.jpg', :title => 'send #{user} a message', :alt => 'send #{user} a message'), new_user_message_path(current_user), :class=>'messageuser' %>

This goes to the current_user's inbox. I want to send the "params[:user_id]" variable along with it so that I can then fill out the "send to" textbox in the inbox page with it. How do I send that params variable along with this button?

© Stack Overflow or respective owner

Related posts about messaging

Related posts about ruby-on-rails