我使用這個第三方控制器: class LibController
def update
# 29 lines of code
respond_with resource
end
end
我想要做的比respond_with在結束其他的東西。但我不想將所有29行復制/粘貼到MyController.update。可惜我不能想出一個辦法
多個關聯我有一個軌道上的紅寶石V上運行的應用程序3。1.9.3與用戶,後和作用模型。用戶有很多帖子和角色。 我的routes.rb文件是這樣的: namespace :api, defaults: {format: 'json'} do
resources :users do
resources :posts
resources :roles
end
en