html:
<html>
<head>
<title>Home</title>
<link rel="stylesheet" type="text/css" href="qa.css" />
</head>
<body>
<div id="wrap"></div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
css:
body {
margin:0;
padding:0;
}
#wrap {
width:750px;
margin-right:auto;
margin-left:auto;
background:#008B00;
}
Run Code Online (Sandbox Code Playgroud)
The html file is called qa.html, and the css file is called qa.css The two files are in the same directory.
我有这个链接:
<%= link_to "+1", video_votes_path( :video_id => video.id, :type => "up" ), :method => :post, :remote => true %>
Run Code Online (Sandbox Code Playgroud)
但是我想把它的视觉外观变成这样:⇑与HTML实体⇑.如何在保持链接功能的同时执行此操作?
我知道.append将代码放在最后,而.prepend将它放在前面,但我在父div中有5个div,我希望在最后一个子div之前动态添加一些html代码.我怎样才能做到这一点?
这是错误:
ActiveRecord::AssociationTypeMismatch in VideosController#update Topic(#2173382840) expected, got String(#2148246520)
这是从这个方法:
def assign_topics
if @topic_names
self.topics = @topic_names.each do |name|
Topic.find_or_create_by_name(name)
end
end
end
Run Code Online (Sandbox Code Playgroud)
这个错误说的是什么?当主题是我的模型时,我不明白是否存在类型"主题"...
我最初添加gem 'rails_admin', :git => 'git://github.com/sferik/rails_admin.git'到我的gemfile但我收到此错误:
Bundler could not find compatible versions for gem "rails":
In snapshot (Gemfile.lock):
rails (3.0.4)
In Gemfile:
rails_admin depends on
rails (~> 3.0.7)
Run Code Online (Sandbox Code Playgroud)
所以我更新到rails 3.0.7并安装 rails_admin (0.0.1) from git://github.com/sferik/rails_admin.git (at master)
我rake rails_admin:install在控制台中运行,我收到此错误:
rake aborted!
undefined method `task'
Run Code Online (Sandbox Code Playgroud)
这是完整的痕迹:
/Library/Ruby/Gems/1.8/gems/railties-3.0.7/lib/rails/application.rb:215:in `initialize_tasks'
/Library/Ruby/Gems/1.8/gems/railties-3.0.7/lib/rails/application.rb:139:in `load_tasks'
/Library/Ruby/Gems/1.8/gems/railties-3.0.7/lib/rails/application.rb:77:in `send'
/Library/Ruby/Gems/1.8/gems/railties-3.0.7/lib/rails/application.rb:77:in `method_missing'
/rubyprograms/dreamstill/Rakefile:7
/Library/Ruby/Gems/1.8/gems/rake-0.9.0/lib/rake/rake_module.rb:25:in `load'
/Library/Ruby/Gems/1.8/gems/rake-0.9.0/lib/rake/rake_module.rb:25:in `load_rakefile'
/Library/Ruby/Gems/1.8/gems/rake-0.9.0/lib/rake/application.rb:495:in `raw_load_rakefile'
/Library/Ruby/Gems/1.8/gems/rake-0.9.0/lib/rake/application.rb:78:in `load_rakefile'
/Library/Ruby/Gems/1.8/gems/rake-0.9.0/lib/rake/application.rb:129:in `standard_exception_handling'
/Library/Ruby/Gems/1.8/gems/rake-0.9.0/lib/rake/application.rb:77:in `load_rakefile'
/Library/Ruby/Gems/1.8/gems/rake-0.9.0/lib/rake/application.rb:61:in `run'
/Library/Ruby/Gems/1.8/gems/rake-0.9.0/lib/rake/application.rb:129:in `standard_exception_handling'
/Library/Ruby/Gems/1.8/gems/rake-0.9.0/lib/rake/application.rb:59:in `run'
/Library/Ruby/Gems/1.8/gems/rake-0.9.0/bin/rake:31
/usr/bin/rake:19:in `load'
/usr/bin/rake:19
Run Code Online (Sandbox Code Playgroud)
发生了什么,我如何安装rails_admin?
这是我的代码:
function transition(index){
$("#right-panel").find("img").each(function(){
if ($(this).index() === index){
setTimeout(function(){
$(this).fadeIn(750);
}, 100000000);
}else{
$(this).fadeOut(750);
}
});
}
Run Code Online (Sandbox Code Playgroud)
由于某种原因,函数中的setTimeout不会导致fadeIn延迟.我究竟做错了什么?