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

--
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.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedNov 18, '11 at 4:37p
activeNov 18, '11 at 4:37p
posts1
users1
websiterubyonrails.org
irc#RubyOnRails

1 user in discussion

Nike Mike: 1 post

People

Translate

site design / logo © 2022 Grokbase