Git 比较不同版本文件差异的常用命令格式:
git diff 查看尚未暂存的文件更新了哪些部分
git diff filename 查看尚未暂存的某个文件更新了哪些
git diff –cached 查看已经暂存起来的文件和上次提交的版本之间的差异
git diff –cached filename 查看已经暂存起来的某个文件和上次提交的版本之间的差异
<div id = "hot_tags_dail"> | |
<% if @model_class.present?%> | |
<div id = "hot_tags_dail"> | |
<%- model_class = @model_class.new.class -%> | |
<!--div class="page-header"> | |
<h1><%=t '.title', :default => model_class.model_name.human.pluralize %></h1> | |
</div--> | |
<%- identity_model_class = Identity.new.class -%> | |
<%- timeline_model_class = Timeline.new.class -%> |
<!DOCTYPE html> | |
<html lang="zh-CN"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<!--%= yield(:title)%--> | |
<!--%= yield(:description)%--><!--%= yield(:keywords)%--> | |
<%= render_page_title %> | |
<%= raw("<meta name='keywords' content='#{@meta_keywords}' />") if @meta_keywords.present? %> |
class AddFieldToUser < ActiveRecord::Migration | |
ActiveRecord::Base.establish_connection "user_#{Rails.env}" | |
def self.up | |
add_column :users, :field, :type | |
end | |
... | |
end |
<!--comment words> | |
You may find that your application requires a layout that differs slightly from your regular application layout to support one particular controller. Rather than repeating the main layout and editing it, you can accomplish this by using nested layouts (sometimes called sub-templates). Here’s an example: | |
Suppose you have the following ApplicationController layout: | |
app/views/layouts/application.html.erb | |
<--> | |
<html> | |
<head> | |
<title><%= @page_title or 'Page Title' %></title> | |
<%= stylesheet_link_tag 'layout' %> |
#麵包屑 | |
gem "breadcrumbs", "~> 0.1.6" |
class Notifier | |
constructor: -> | |
@enableNotification = false | |
@checkOrRequirePermission() | |
hasSupport: -> | |
window.webkitNotifications? | |
requestPermission: (cb) -> | |
window.webkitNotifications.requestPermission (cb) |
Git 比较不同版本文件差异的常用命令格式:
git diff 查看尚未暂存的文件更新了哪些部分
git diff filename 查看尚未暂存的某个文件更新了哪些
git diff –cached 查看已经暂存起来的文件和上次提交的版本之间的差异
git diff –cached filename 查看已经暂存起来的某个文件和上次提交的版本之间的差异
#lib/paper_trail/extras_version.rb | |
#because one **require statement** can only require one times, you cannot just create one file named 'version.rb' and place in 'app/models/ ' folder. | |
class Version | |
#class << self | |
def object_hash | |
YAML.load self.object if self.object.present? | |
end | |
def whodoit |
<div id="error_page" class="box"> | |
<h1>Ops, 404</h1> | |
<p> | |
似乎没有这个页面哦!大哥,去看看别的吧。 | |
</p> | |
</div> | |
<!--因为不排除连rails 都无法运行的情况 所以添加 'public/STATUS.htm' 还是很有必要的--> | |
<!--more> | |
Finally, the default exceptions application used by Rails that simply renders a page in `public/STATUS.html` is available here: [action_dispatch/middleware/public_exceptions.rb](https://github.com/rails/rails/blob/master/actionpack/lib/action_dispatch/middleware/public_exceptions.rb) | |
Remember that whatever you do in the errors controller, it should not be anything “fancy”. Keep it simple because something already went wrong with your application! |
require "bundler/capistrano" | |
require "whenever/capistrano" | |
# RVM bootstrap | |
#$:.unshift(File .expand_path( "~/.rvm/lib" )) | |
set :rvm_ruby_string , 'ruby-1.9.3-p194@askjane' #这个值是你要用rvm的gemset。名字要和系统里有的要一样。 | |
#set :rvm_ruby_string, ENV['GEM_HOME'].gsub(/.*\//,"") # Read from local system | |
set :rvm_type , :user # Don't use system-wide RVM | |
require 'rvm/capistrano' |