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.