On Mon, Dec 5, 2011 at 9:13 AM, Nike Mike <li...@ruby-forum.com> wrote:
> 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) > try this $('#dialog_box_id').html('<%= escape_javascript @message.description%>') > > Please help us > > -- > 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+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > -- ------------------------------------------------------------- visit my blog at http://jimlabs.heroku.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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.