Jquery dialog

Hi,

i had a index page with url as www.exa,com/users/jude.In that page i want to submit a from which appears from popup dialog.The action of the popup is going to send_message,Whenever i submits, via ajax the data gets stored but not the page gets reflected.

My controller def send_message     @message = current_user.messages.build(params[:message])     @message.receiver_id = @user.id     respond_to do |format|       if @message.save         format.html {redirect_to user_url(current_user)}       format.js       end     end

  end

View file

%div.jqmWindow#dialog   %div.dialog_content     -form_for Message.new,:url=>'users_message_path',:remote=>true do

f>

      =hidden_field_tag :id,@user.login       =f.text_area 'content',:rows => 10, :cols => 25       =f.submit 'Send'

My js.erb $('#dialog').html("hello")

Problem is ajax is requestuing the action /users/send_message and not /users/jude