The problem is in these lines:
%a{:class => 'btn-mini dropdown-toggle', "data-toggle" => 'dropdown', :href => '#'} Action
%span{:class => 'caret'}
The error message: content can't be both given on the same line as %a and nested within it
refers to Action
which is content “on the same line as %a”, and %span{:class => 'caret'}
, which is content “nested within it”.
More generally, and perhaps easier to see, you can’t have something like this:
%tag Some content here
And something here as well
The fix is to nest both under the %a
:
%a{:class => 'btn-mini dropdown-toggle', "data-toggle" => 'dropdown', :href => '#'}
Action
%span{:class => 'caret'}
This gives the desired output:
<a class='btn-mini dropdown-toggle' data-toggle='dropdown' href='#'>
Action
<span class='caret'></span>
</a>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…