Skip to content

Instantly share code, notes, and snippets.

@jackcallister
Created August 7, 2015 07:36
Show Gist options
  • Save jackcallister/ad121efaaab9ce826a77 to your computer and use it in GitHub Desktop.
Save jackcallister/ad121efaaab9ce826a77 to your computer and use it in GitHub Desktop.
import Flux from './Flux.js'
import Flux from './components/App.jsx'
// Within document ready
const payload = document.getElementById('payload');
const flux = new AppFlux();
flux.serialize(payload);
React.render(
<FluxComponent flux={flux}>
<App />
</FluxComponent>,
document.getElementById('app')
)
# Controller
def action
@payload = {MyStore: { data: [] }}
end
# View
<input value=<%= @payload %> type='hidden' id='payload' /> # Be sure to stringify hash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment