javascript - print another page from the current page rails 4 -
<% @service_requests.each |sr|%>
<iframe src="<%= url_for :controller=>'service_requests',:action=>'show',:id=>sr.id%>" name="frame" style="display:none;" ></iframe>
<input type="button" onclick="frames['frame'].print()" value="printletter">
<%end%>
i want print show page index page.through code able print show page concern id.now getting 2 records having id=17 , id=15.when printing record id=17,it's working fine.but if want print record id 15 getting show page id 17.
what want partial views. render show page id this;
<%= render :partial => "service_requests", :locals => {:id => sr.id} %>
Comments
Post a Comment