You need to use Ajax there.

Instead of form_for  you will need to use form_remote_for.

regards,
Sur

http://crimson9.com

Mamadou Touré wrote:
> Sur Max wrote:
>> 
>> render :js is something that can be used in place of the render :update.
>> Which means, the request type should be XHR and not HTTP... in simple 
>> words, the render :js will only work for Ajax requests.
>> 
>> If you want something of this sort for the normal HTTP requests... it 
>> can be achieved by something like this in your controller...
>> 
>> 
>> @js = "alert('hi')" # or whatever set of js statements needed
>> render :inline => "<%= javascript_tag(@js) %>"
>> 
>> 
>> regards,
>> Sur
>> 
>> http://crimson9.com
> 
> Hi Sur,
> 
> I did what you suggested, yes it displays the alert, but behind it my 
> originala screen has disappeared. What I want is to display the alert 
> without having the screen where the user pressed the submit button 
> disapears.
> 
> regards

-- 
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 [email protected].
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.

Reply via email to