如果传递了 id,我想从 Index 操作委托给 Show 操作。我似乎无法让它工作,我在这里做错了什么?
require 'ramaze'
require 'slim'
class UsersController < Ramaze::Controller
engine :slim
def index(id=nil)
if id
render_full "/users/show/#{id}" #id was passed, "show" the item
end
#alright just render the "index.slim" here...
end
def show(id)
u=User[id] #ORM stuff...
end
end
Ramaze.start