我也有一个 400+ Model 的 rails 项目,不过没有遇到 @linjunhalida 的问题啊?你检查一下是否引用了 googlde 字体吧?一般应该是这个导致页面加载缓慢,换成 360 的 web 字体就好了。
<link href='http://fonts.googleapis.com/css?family=Russo+One' rel='stylesheet' type='text/css'>
<link href='http://fonts.useso.com/css?family=Russo+One' rel='stylesheet' type='text/css'>
果断 4.1.4,另外 3.2 的小版本号已经是 3.2.19 了。。
类似这样?用 content_for 和 yield,甚至 render 也行。
app/views/lots/dp.html.erb
<% if @lot.lotattributes.stdmrgebatch.present? -%>
<% title = "#{@lot.lotattributes.stdmrgebatch} #{@product.packagecategory.packagecategoryname} #{@product.densitycode} DP"
content_for :title, title %>
<% else -%>
<% title = "#{@product.packagecategory.packagecategoryname} #{@product.densitycode} #{@lot.containername} DP"
content_for :title, title %>
<% end -%>
<%= render :partial => 'navbar', :locals => {:title => title, :print_template => 'dp' } %>
app/views/layouts/application.html.erb
<!doctype html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title><%= (yield(:title) + " - " unless yield(:title).blank?).to_s + "MES View" %></title>
<%= stylesheet_link_tag "application", media: "all" %>
<%= javascript_include_tag "application" %>
<%= csrf_meta_tags %>
</head>
<body data-spy="scroll" data-target=".navbar">
<% if notice.present? -%>
<div class="alert alert-info"><%= notice %></div>
<% end %>
<%= yield %>
</body>
</html>
换成 if else。。。
换 java 7 的 runtime 试试,官方 Rubymine 应该还不支持 java 8 的 runtime。
要不你试试我的 Ruby200p481,直接解压缩到 C:\即可。
将 ruby 和 devkit 全部装在 C 盘,就酱子。。
File->Settings->Ruby SDK and Gems 选到 2.0 即可。
我用 fixture,好处是 test 和 development 的数据可以用同一套,而且 test 跑的速度很快,缺点是维护起来稍麻烦。
rake db:fixtures:load FIXTURES_PATH='spec/fixtures' RAILS_ENV=development
版本?降到 Rubymine 6.3.2 试试?
不是大牛,升级到 rails 4。。。
升级了,ruby.taobao.org 现在很重要。。
#2 楼 @blacktulip 好吧,我想当然了,我只有 p290 的版本,不知道楼主能不能用了。。 rubyinstaller-1.9.2-p290.exe
文件对的,只不过需要 FQ
#5 楼 @qichunren 我检查了,没有定义,我这个是正解。
Capfile 里面,禁掉 bundle 就会跳过这个。
# require 'capistrano/bundler'
.row {
margin-top: 4px;
margin-bottom: 4px;
}
bootstrap3应该用这个 gem,更方便。
#2 楼 @egg_show 可以是不同连接,或者是相同连接,余下的问题我在实际使用中从不考虑,所以抱歉无法回答。
我有关注,不发言不代表没人看。。。楼主问出结果记得填坑。 。。