我有一個動作是這樣的:不同版本的同一個控制器動作軌道3
def show
@p = Post.find(params[:id])
respond_to do |format|
format.html
format.js
end
end
我得到一個網址的東西:
http://localhost:3000/post/1
http://localhost:3000/post/2
http://localhost:3000/post/3
.
.
.
我想有這同樣的動作不同版本是這樣的:
http://localhost:3000/v1/post/1
http://localhost:3000/v1/post/2
http://localhost:3000/v1/post/3
.
.
.
哪有我這麼做?
我看看這個資源:
https://github.com/bploetz/versionist
http://railscasts.com/episodes/350-rest-api-versioning?view=asciicast