I want the the table to be displayed in pdf format .
we are using
format.html
format.json{render json: @user}
et
I think this might help [ https://github.com/mileszs/wicked_pdf ]
You will always be able to use like format.pdf as long as your route supports .:format part. So just use that to capture the request for pdf. Then render the pdf using wicked_pdf.
The basic usage is showing there as below
def controller_action
... ... ...
... ... ...
format.pdf do
render :pdf => "file_name"
end
end
Here is another article might help to understand the usage.