SitePoint Sponsor |
|
User Tag List
Results 1 to 2 of 2
Thread: Ajax with layout templates
Threaded View
-
Nov 26, 2006, 06:15 #1
- Join Date
- Dec 2004
- Location
- Syria
- Posts
- 12
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Ajax with layout templates
Hello,
Here is the situation:
I have a List action that lists items for me (scaffold generated), now I need to the destroy method to be ajaxed, I wrote the following:
Code:<%=link_to_remote ('Destroy', :update => "main", :url => {:action => 'destroy', :id => @category}, :confirm => 'Are you sure?', :post => true, :loading => "document.getElementById('loading').style.display='inline'", :loaded => "document.getElementById('loading').style.display='none'")%>
Code:def destroy Category.find(params[:id]).destroy redirect_to :action => 'list'
I have searched the rails documentation and found this:
render :action => "list", :layout => false
But this didn't work, it caused an error.
Do you suggest some other solution?
Bookmarks