I am using jQuery to do an ajax call to my controller, and everything is working perfectly, except I can't quite get the return value that I want.
Let's say I have a collection of items, and I have the partial:
/app/views/messages/_message.html.erb
I am trying to render it as a big string of text/html like so:
format.js { render_to_string :partial => "message", :collection => @messages}
However, this is rendering a view of some sort, because I'm getting and tags. Even if I change it to:
format.js { render_to_string :partial => "message", :collection => @messages, :layout => 'none'}
it still returns the same thing. Is this possible? I need to return it for jQuery to handle it, so I'm not sure if this can be done with rjs. Any help is appreciated.