我目前正在尝试将inherited_resources和权限集成到我的Rails应用程序中。 对于检查基于资源执行控制器操作的能力,我有点卡住了。此代码是作为一个例子给出权威: def edit
@llama = Llama.find(params[:id])
authorize_action_for(@llama) # Check to see if you're allo
我试过在rails4应用程序使用IR,但我的代码 class WorkspacesController < InheritedResources::Base
private
def permitted_params
params.permit(:workspace => [:name, :owner_id])
end
end
加载ActiveMod
我有一个模型订单。在索引中,我希望current_user只用他们的命令查看索引。订购belongs_to:admin_user。 AdminUser has_many:订单。我在我的应用程序中使用activeadmin,如果这有所作为。我收到此错误: Couldn't find Order without an ID
行给出错误在我的订单控制器的第二行(节录不必要的信息) index do
。下面是一个抽象的例子: # routes.rb
resources :tasks do
resources :comments
end
namespace :admin do
resources :projects do
resources :comments
end
end
# comments_controller.rb
class Co