我刚刚开始学习ROR,目前正在制作我自己的第一个应用程序 - 待办事项列表 . 我完成了它,它运行良好,但我想通过更改CSS改善外观 . 我不知道原因,但现在当我点击"New task"模态窗口打开时,整个页面上出现错误并且它处于非活动状态 . 见screenshot . 实验方法我删除了css中的所有更改,但问题没有解决 .

有模态窗口的css设置:

.modal form {margin-bottom:10; } span.error {color:red; margin-left:5px; }

这是html.haml:

.modal-header%h2 = task.new_record? ? '新任务':“编辑任务#”= simple_form_for @task,class:'clearfix',remote:true do | f | .modal-body = f.input:title = f.input:note = f.input:completed,as :: string,input_html:{class:'datepicker',value:task.completed.present? ?本地化(task.completed,格式:'%d /%m /%Y'):nil} .modal-footer = f.submit'保存',类:'btn btn-primary'

如果需要发送一些我可以做的其他代码 . 我将不胜感激任何帮助!

增加:有html.haml布局,其中是模态按钮:

!!!
%html
  %head
    %title ToDo
    = stylesheet_link_tag    "application", media: "all"
    = javascript_include_tag "application"
    = csrf_meta_tags
  %body
    #header/
    %h1 ToDo
    %p time management application
  .text-center
    = link_to 'New task', new_task_path, class: 'btn btn-primary', remote: true
  .text-right
    %strong= current_user.email
  .text-right
    = link_to 'logout', destroy_user_session_path, method: :delete
  = yield

ADDED2 . 是的,模态是通过javascript触发的 . 有代码:

m = $('#modal');
m.html('<%= j(render partial: 'task_form', locals: {task: @task}) %>');
m.modal('show');
$('#modal').integrateDatepicker();

我不太明白 - 上面发布的模态的html.haml代码...(从.modal-header开始)

我尝试通过bootlint检查所有可能的页面,但没有发现错误 .