This commit is contained in:
parent
b72d65ddbd
commit
d3823a12ec
|
@ -6,14 +6,7 @@
|
|||
<link href="style.css" rel="stylesheet" />
|
||||
</head>
|
||||
<body>
|
||||
<h1>Rails-routes</h1>
|
||||
<h2>mapping</h2>
|
||||
|
||||
<p><a href="http://guides.rubyonrails.org/routing.html">Guides/Routing</a></p>
|
||||
|
||||
<p><a href="Rhttp://api.rubyonrails.org/classes/ActionDispatch/Routing/Mapper.html">ActionDispatch::Routing::Mapper</a>
|
||||
(See included modules)</p>
|
||||
|
||||
<h1>Rails Routes</h1>
|
||||
<h3>Multiple resources</h3>
|
||||
|
||||
<pre><code>resources :books
|
||||
|
@ -66,6 +59,17 @@ match 'photo/*path' => 'photos#unknown' # /photo/what/ever
|
|||
match 'photos/:id' => 'photos#show', :defaults => { :format => 'jpg' }
|
||||
</code></pre>
|
||||
|
||||
<h3>Get/post</h3>
|
||||
|
||||
<p><code>get</code> is the same as <code>match via: :get</code>.</p>
|
||||
|
||||
<pre><code>get 'photo/:id' => 'photos#show'
|
||||
# same as match 'photo/:id' => 'photos#show', via: :get
|
||||
|
||||
post 'photo/:id' => 'photos#update'
|
||||
# same as match 'photo/:id' => 'photos#show', via: :post
|
||||
</code></pre>
|
||||
|
||||
<h3>Redirection</h3>
|
||||
|
||||
<pre><code>match '/stories' => redirect('/posts')
|
||||
|
@ -189,6 +193,14 @@ root :to => 'welcome#index'
|
|||
match ':controller(/:action(/:id(.:format)))'
|
||||
</code></pre>
|
||||
|
||||
<h3>References</h3>
|
||||
|
||||
<ul>
|
||||
<li><p><a href="http://guides.rubyonrails.org/routing.html">Guides/Routing</a></p></li>
|
||||
<li><p><a href="http://api.rubyonrails.org/classes/ActionDispatch/Routing/Mapper.html">ActionDispatch::Routing::Mapper</a>
|
||||
(See included modules)</p></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/1.6.4/jquery.min.js'></script>
|
||||
<script src="http://cachedcommons.org/cache/prettify/1.0.0/javascripts/prettify-min.js"></script>
|
||||
|
|
|
@ -4,7 +4,7 @@ title: Cheat sheets
|
|||
- Dir['./*.*'].each do |p|
|
||||
- name = File.basename(p, '.*')
|
||||
- ext = File.extname(p)
|
||||
- next if %w[.sass .scss].include?(ext) || %w[config Gemfile index].include?(name) || name[0] == '_'
|
||||
- next if %w[.sass .scss].include?(ext) || %w[config Gemfile Rakefile README index].include?(name) || name[0] == '_'
|
||||
- url = name + ".html"
|
||||
%li
|
||||
%a{href: url}= name
|
||||
|
|
37
tig.md
37
tig.md
|
@ -1,7 +1,12 @@
|
|||
Tig shortcuts
|
||||
-------------
|
||||
|
||||
Invocation
|
||||
### Installing
|
||||
|
||||
$ brew install tig --HEAD
|
||||
$ apt-get install tig
|
||||
|
||||
### Invocation
|
||||
|
||||
tig blame FILE
|
||||
tig master # Show a branch
|
||||
|
@ -9,24 +14,24 @@ Invocation
|
|||
tig FILE # Show history of file
|
||||
tig v0.0.3:README # Show contents of file in a specific revision
|
||||
|
||||
All views
|
||||
---------
|
||||
### All views
|
||||
|
||||
* `^N` - Next on parent view
|
||||
* `^P` - Previous on parent view
|
||||
^N # Next on parent view
|
||||
^P # Previous on parent view
|
||||
|
||||
`m` - Main view
|
||||
* `D` - Toggle between date display modes
|
||||
* `A` - Toggle between author display modes
|
||||
* `C` - Cherry pick a commit
|
||||
### `m` - Main view
|
||||
|
||||
`S` - Stage view
|
||||
D # Toggle between date display modes
|
||||
A # Toggle between author display modes
|
||||
C # Cherry pick a commit
|
||||
|
||||
* `u` - Stage/unstage file or chunk
|
||||
* `!` - Revert file or chunk
|
||||
* `C` - Commit
|
||||
* `M` - Merge
|
||||
### `S` - Stage view
|
||||
|
||||
`H` - Branch view
|
||||
u # Stage/unstage file or chunk
|
||||
! # Revert file or chunk
|
||||
C # Commit
|
||||
M # Merge
|
||||
|
||||
* `i` - Change sort header
|
||||
### `H` - Branch view
|
||||
|
||||
i # Change sort header
|
||||
|
|
Loading…
Reference in New Issue