<% board = @contest.boards.where("parent_id is NULL").first %>
<%= form_tag url_for(:controller => 'boards', :action => 'create', :contest_id => @contest.id, :board_id => board.id), :id=> 'add_board_form_subboard',:remote => true do %> <% end %>
<% count = board.children.count %> <% board.children.reorder("position asc").each_with_index do |board, i|%> <% end %>
名称 操作
竞赛讨论区 添加子栏目
<% unless i == 0 %> <%= link_to('上移', {:controller => 'boards', :action => 'update_position', :id => board.id, :contest_id => @contest.id, :opr => 'up'},:remote => true, :method => 'post', :class => "sy_btn_blue mr5", :title => '上移') %> <% end %> <% if i < count - 1 %> <%= link_to('下移', {:controller => 'boards', :action => 'update_position', :id => board.id, :contest_id => @contest.id, :opr => 'down'},:remote => true, :method => 'post', :class => "sy_btn_blue mr5", :title => '下移') %> <% end %> 编辑 删除