gazay / gon

Your Rails variables in your JS
MIT License
3.05k stars 185 forks source link

Add some quick information about what it's actually doing #180

Open fbernier opened 9 years ago

fbernier commented 9 years ago

I just quickly stumbled upon this repository and couldn't find much information about what it's actually doing to make the variables available in the JS. It is something I would want to know before using such a library and I guess having this information in the README would be useful instead of going through the code.

gazay commented 9 years ago

Sure! This information is in usage section: https://github.com/gazay/gon#usage

fbernier commented 9 years ago

My bad, I went too quickly. Thanks!

gazay commented 9 years ago

No problem =)

gazay commented 9 years ago

Ah sorry, I went to quickly in issue, so I misunderstood you. Do you mean I need to provide information about internal gon flow, how it stores data from action and then renders it in view? But I thought it is pretty clear – it just stores data for current request inside Gon RequestStore, then when view calls include_gon – it takes it from there and converts to json and add script tag with it.

fbernier commented 9 years ago

Yes, this I what I meant. It is indeed quite clear it should be doing what you just described once you read the usage section correctly, but the I believe the short description you just gave could be worthy of being included somewhere.