<% content_for :after_javascript_libraries do %>
  <%= javascript_include_tag 'refinery/nestedsortables' %>
  <%= javascript_include_tag 'refinery/serializelist' %>
  <%= javascript_include_tag 'refinery/tree.js' %>
<% end %>

<% content_for :javascripts do %>
  <script>
    $(document).ready(function(){
      list_reorder.update_url     = '<%= update_url ||= refinery.url_for(:action => "update_positions") %>';
      list_reorder.sortable_list  = $('#<%= list_id ||= "sortable_list" %>, .sortable_list');
      list_reorder.tree           = <%= tree %>;
      list_reorder.init();
    });
  </script>
<% end %>

<% content_for :after_javascript_libraries do %>
  <%= javascript_include_tag 'refinery/nestedsortables' %>
  <%= javascript_include_tag 'refinery/serializelist' %>
  <%= javascript_include_tag 'refinery/tree.js' %>
<% end %>

<% content_for :javascripts do %>
  <script>
    $(document).ready(function(){
      list_reorder.update_url     = '<%= update_url ||= refinery.url_for(:action => "update_positions", :only_path => true) %>';
      list_reorder.sortable_list  = $('#<%= list_id ||= "sortable_list" %>, .sortable_list');
      list_reorder.tree           = <%= tree %>;
      list_reorder.init();
    });
  </script>
<% end %>

Fix a bug when default_url_options[:host] is not setted at action controller in production mode.
Fix a bug when default_url_options[:host] is not setted at action controller in production mode.