试试 ruby -Ilib test/test_xxx.rb
贴代码。
那么,在哪里可以买到呢?
layout false
翻墙了没?
.html.erb
,先用 erb 进行处理,erb 不管 HTML 的注释标签,直接找 <%
。
编辑器右上角有插入代码的按钮
<!-- <%= form_for @event, :url=> {:controller=>'events', :action=>'create'} do |f| %> -->
<%= form_for @event, url => events_path do |f| %>
<!-- <%= render :partial=>'form', :locals=>{:f=>f} %> -->
<%= f.label :name, "Name" %></br>
<%= f.text_field :name %></br>
<%= f.label :description, "description" %></br>
<%= f.text_area :description %></br>
<%= f.submit "create" %>
<% end %>
#3 楼 @yangman_wenzhu 打少冒号之类。
f t 这样的变量名过几天你还记得什么意思吗?
t 是个 helper, http://apidock.com/rails/v4.1.8/ActionView/Helpers/TranslationHelper/t
换别的名字。
#2 楼 @mogodb http://caniuse.com/#search=video
注意 IE 的国情和国际不符。好像优酷的 iPad 版是 HTML5 播放器。
#6 楼 @hxh1246996371 因为内存不用就是浪费,但是用尽容易宕机,建议让内存占用在 50%~70% 之间。
你可以用 ab 工具测试一下并发性能,小网站并发并不高,中等以上网站估计到时已经有经验了。
和其他 Rails 项目来比不算大。设置数量要看你用什么部署的。
排版可以去掉引用格式。
我奇怪系统没提示重启,原来 Ubuntu 14.04 不受影响。
https://www.linode.com/docs/security/security-patches/patching-glibc-for-the-ghost-vulnerability
其实 Rails 默认配置已经给出提示:
# As with config/secrets.yml, you never want to store sensitive information,
# like your database password, in your source code. If your source code is
# ever seen by anyone, they now have access to your database.
#
# Instead, provide the password as a unix environment variable when you boot
# the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database
# for a full rundown on how to provide these environment variables in a
# production deployment.
#
# On Heroku and other platform providers, you may have a full connection URL
# available as an environment variable. For example:
#
# DATABASE_URL="mysql2://myuser:mypass@localhost/somedatabase"
#
# You can use this database configuration with:
#
# production:
# url: <%= ENV['DATABASE_URL'] %>
#
production:
<<: *default
database: app_production
username: app
password: <%= ENV['APP_DATABASE_PASSWORD'] %>
搜 rails log_tags
因为很重要所以说两次,因为很重要所以说两次!
https://www.linode.com/longview 可以用在 Linode 以外的主机。