Created
May 15, 2016 02:18
-
-
Save alanbsmith/f5ffcac46cde466c581c50c3c11c37af to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'json' | |
module ReactHelper | |
def react_component(component_name, props = {}) | |
content_tag( | |
:div, | |
nil, | |
class: 'react-component-target', | |
data: { | |
react_class: component_name, | |
react_props: props.to_json | |
} | |
) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment