The easiest way to get source code for Ruby / Rails

As an opaque Ruby / Rails, I often want to check the code for the rails method to see how it is implemented ...

For example, I used "form_for" and I wanted to check the code to see how it works. The slightly lame way I did this is just google's "rails form_for" which will lead me to http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html where I can view the source for form_for .

How do rails / rubies perform a similar task? Is there an easy way (without using an IDE) that you can quickly calculate? Or is it a case of time exploring where the material is and finding / grep -it?

Greetings

+3
source share
2 answers

I prefer http://railsapi.com/ both local and remote. Quick Search, Beautiful Design, and Magic Show on Github Link

+1
source

I am cloning a rail repository

git clone git://github.com/rails/rails.git

after i click on it

git grep 'form_for'

After my Vim editor helps me with Ctags go to the source code.

If you need an example of using the code, you can see the test block.

+3
source

Source: https://habr.com/ru/post/1770518/


All Articles