Thursday 27 October 2016

To copy file from remote server to local machine

Try following command to copy any file from remote server to your local machine .

scp -r -P port usrname@ip:/path-to-folder .

example: scp -r -P 27000 abc@10.70.12.12:/tmp/hotel_dump .
port = 27000 username = "abc" , remote server username path-to-folder = tmp/hotel_dump . = current local directory

Friday 7 October 2016

Difference between <%, <%=, <%# and -%> in ERB in Rails?

<% %>
Executes the ruby code within the brackets.
<%= %>
Prints something into erb file.
<% -%>
Avoids line break after expression.
<%# %>
Comments out code within brackets; not sent to client (as opposed to HTML comments).