我是ruby的新手,我这里有一个删除按钮的代码
function countdown(){
var start = 10; // start of countdown in seconds
var link = 'http://www.example.com/'; // link to display
if($('#link').text() < 1){ // check if the text of the span-element
$('#link').text(start); // with id #link is a number. if not, put the
} // value of var start in this element
setTimeout(function(){ // start a timeout event
var current = $('#link').text() - 1; // get text of #link and reduce it by one
// and make it a variable with name "current"
if(current > 0){ // if var current is higher than 0 execute the
countdown(); // function one more time
}else{ // if not, set var link as var current
current = '<a href="' + link + '">' + link + '</a>';
}
$('#link').html(current); // output var current into span element #link
}, 1000); // 1000 = 1 second
}
$(document).ready(function(){
countdown(); // execute function on page load
});
我想将= xs_danger_btn_to "Verwijderen", time_keeper_employee_manager_role_path(@time_keeper, supervisor, manager_role), method: :delete, :btn_class => "custom"
类更改为我自己的东西,例如color / hover / border等。在css。我怎么能这样做?
我正在运行ruby版本:2.3.1p112
答案 0 :(得分:1)
看起来你没有使用ruby erb的标准语法。你可以试试这个:
= link_to "Verwijderen", time_keeper_employee_manager_role_path(@time_keeper, supervisor, manager_role), method: :delete, :class => "insertyournewclass"
更改&#39; insertyournewclass&#39;与您想要的任何课程,例如:&#39; btn btn-primary btn-sm&#39;如果你使用bootstrap