Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要调用一些javascript,同时在rails 3中渲染部分内容。比如:
_my_partial.html.erb
每当此部分呈现时,都应调用 javascript 函数。
试试这个_my_partial.html.erb:
对于html:
html
# partial code <script type="text/javascript"> your_function(); </script>
对于haml:
haml
# partial code :javascript your_function(#{@variable});