Ajax dialogs with jquery

Hi,

In my application, we are calling a dialog box to submit a value through
ajax.After submit how to show the welcome message in the same dialog.

In my views file at the first the dialog block is in hidden mode.On
clicking an anchor we are displaying the dialog block form.Through Ajax
we are submitting the values. In my .js.erb alert messages are working
fine.

But how to place the entire layout with the dialog welcome message ?

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

send_message.js

alert(@message.description)

Please help us

On Mon, Dec 5, 2011 at 9:13 AM, Nike M. [email protected] wrote:

   format.js
 end

end
end

send_message.js

alert(@message.description)

try this

$(’#dialog_box_id’).html(’<%= escape_javascript @message.description%>’)

To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.

Thanks its working

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs