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

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -