I have this:
ActiveAdmin.register User do
controller do
def show
@user = User.find(params[:id])
show!
end
end
show do
attributes_table do
row "User" do
link_to @user.display_name, user_path(@user.slug)
end
end
end
end
But when I load the page, I get an error saying:
undefined method `display_name' for nil:NilClass
which means that @user is nil. I am positive that @user is set appropriately (meaning the finder is getting appropriate data that exists in the db). I'm thinking it has something to with how ActiveAdmin works that I'm unfamiliar with. Any thoughts?
Also, I know I could do show do |user|
, but there are more complicated things I am using this for and need access to the user object in the controller.