Reputation: 1246
I used:
render_to_string(:controller=>:controllerName,:action=>:actionName)
but this only gives me the content of header and footer and not the actual content of that specific page.
Is there any other way?
Thanks
Upvotes: 1
Views: 832
Reputation: 3670
@var = render_to_string(:template => "controller/action", :layout => false)
Upvotes: 1
Reputation: 9362
I have used
@var = render_to_string(:file => "view_folder/index", :layout => false).to_json
to get data from render_to_string, and it works fine..
Upvotes: 1