Rails: How to use javascript variable outside of <script ... / "> but inside the view?
In the view, I have a script (javascript) that declares a variable after some deep processing. How to use this variable outside the borders of the script on the same view page?
some_view.html.erb
<script>var seq = Sortable.sequence('list');</script>
# How to do this? Is it possible?
<%= sortable_element "list",
:update => "order",
:complete=> visual_effect(:highlight, "list"),
:scroll => 'list',
:url=>{:action=>"order", :order_init => seq} %>
Thank!
+3
2 answers