0

レールでボタンを非表示にすると、他のボタンがその場所に移動します。ボタンを平行線に配置したいのですが、他のボタンがその場合に見えない場合は、他のボタンの場所を明確にする必要があります....私のコードは次のとおりです:

<div class=" list_el">
              <span class="pull-right" style="text-align:right">
              <%if accountant?%>
                <%= link_to_if(!crm_donation["received"],  "Approved", crm_donations_path(:id => crm_donation["id"]), :class => "label label-success") if !crm_donation["received"]%>
              <%end%>

              <%= link_to "rollback", edit_crm_donation_rollback_path(crm_donation["id"]), :class => 'label label-info'  if supervisor? && crm_donation["rollback_id"].blank?%>

              <%= link_to "delete",  crm_donation_path(crm_donation["id"]), :class => 'label label-important1', method: :delete, data: { confirm: 'Are you sure?' } if accountant? && !crm_donation["received"]%>

              <%= link_to "details", crm_donation_path(crm_donation["id"]), :class => 'label label-success' %>


              <%if !accountant?%>
                <%= link_to "pdf", "/letter/#{crm_donation["id"]}.pdf", :class => "label label-info1", :target=>"_blank"%>

                <%if crm_donation["email_sent"]%>
                  <%=link_to_if(crm_donation["received"], "email", donation_email_sent_path(crm_donation["email_sent"]), :class=>"label label-emails") { label_tag( "email" , "email",:class => "label") }%>

                <%else%>
                  <%if !crm_donation["rollback_id"]%> 
                    <%=link_to_if(crm_donation["received"], "email", new_donation_email_sent_path(:donation_id => crm_donation["id"]), :class=>"label label-emailf") { label_tag( "email" , "email",:class => "label") } %>
                  <%end%>  

                <%end%>
              <%end%>

            </span>
            </div>

ボタンの位置は次のようになります。

                 details | pdf
rollback | details | pdf | email

そして、私はこのようにしたい:

           details | pdf
rollback | details | pdf | email
4

1 に答える 1

0

まず、インライン スタイルを削除し、すべてのスタイルをアセット パイプラインに配置します。ボタンごとに div を作成し、CSS の配置を使用して適切に配置します。一部のボタンを非表示にしていて、ボタンの配置を変更している場合 (質問で述べたように)、display: none ではなく、visibility: hidden を使用します。特定の要素に Visibility: hidden を実行するときと同様に、その要素は引き続き存在しますが、非表示になります

于 2013-09-16T10:37:50.583 に答える