I’ve highlighted the ruby code by CodeRay and now I’d like to know on which line number user clicked. This line number should correspond to line nuber in source code. Which is the best way to do this?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Here’s how I resolved this question.
I generated html with the numbers by CodeRay. But CodeRay doesn’t have accurate documantation on official site, so after looking throught the CodeRay’s code I’ve made it like this:
The mode
:line_numbers => :tabledoesn’t work properly in my case that’s I should’ve use:inlinemode. If you don’t like numbers in your html page i think you can remove it by css or javascript.Then I wrote small javascript function:
Any suggestions and improvements will be appreciated.