Hello guys
I have animals/index.html.erb
<%= link_to_remote(‘List’,:update => ‘cont’, :url => {:action =>
:list})%>
page list
And animals/list.html.erb
And animals/_list.html.erb
Name | Desc | |||
---|---|---|---|---|
<%=h animal.name %> | <%=h animal.desc %> | <%= link_to 'Show', animal %> | <%= link_to 'Edit', edit_animal_path(animal) %> | <%= link_to 'Destroy', animal, :confirm => 'Are you sure?', :method => :delete %> |
and controller
def list
@animals = Animal.paginate(:page => params[:page], :per_page => 3)
respond_to do |format|
format.html
format.js {
render :update do |page|
page.replace_html ‘cont’, :partial => ‘list’
end
}
end
end
then i got following o/p
try { Element.update(“cont”, "
\n \n Name\n Desc\n
\n\n\n \n dog\n dog\n Show\n Edit\n
\n \n Name\n Desc\n
\n\n\n \n dog\n dog\n Show\n Edit\n Destroy\n
\n\n \n horse\n horse\n Show\n Edit\n Destroy\n
\n\n \n cow\n cow\n Show\n Edit\n Destroy\n
\n\n
\n
« Previous 1 2 Next »
");’); throw e }
if any solution please give me