-5

I'm not able to call the CSS style, I don't know what the reason is, I'm going to do that. The code is shown below

orders.scss

table{
  width:30em;
  table-layout:fixed;
}

td {
    width:100%;
    word-break:keep-all;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

order.html.slim

.row
  .col-md-9
    .box.box-primary
      .box-header.with-border
        h3.box-title 列表
      .box-body.no-padding
        table.table
          tbody
            tr
              th 手机号

              tr
                td = 123456
Mr Lister
  • 45,515
  • 15
  • 108
  • 150
zhanghao
  • 25
  • 6

1 Answers1

0

Thanks everyone. I am a new guy. The reason for the problem is that I didn't properly refer to the orders.scss style.

Since the project is using slim. At the beign of orders.html.slim,I need to add the following code:

- content_for :preload_stylesheets
  =stylesheet_link_tag   'orders', media: 'all'

Then config/initializes/assets add the following code :

Rails.application.config.assets.precompile += %w(
...
orders.scss
...
)

Finally,it can implement the reference of orders.scss

zhanghao
  • 25
  • 6