Question: I successfully set-up the decent\_exposure gem as this [railscast](http://asciicasts.com/episodes/259-decent-exposure).

I would like to use scope access with current\_user for the edit / update / create action in order to avoid checking the permission by comparing the owner of object with current\_user.

Controller :

```
class CommentsController < ApplicationController  
 expose(:article)  
 expose(:comments) { article.comments }  
 expose(:comment)  

 def index  
 end  

 def new  
 end  

 def create  
  if comment.save  
   redirect_to comment.article, :notice => "Successfully created comment!"  
  else  
   render :new  
  end  
 end  
end

```

How can I have with decent\_exposure something like this in my edit action for example :

```
@comment = current_user.comments.find(params[:id])

```

Thanks in advance !

Answer: 
i think you could do:

expose(:user\_comments) { current\_user.comments }

expose(:user\_comment)

the user\_comment should be scoped to current\_user.comments and you would use user\_comment would be used in your view.
This should work:
`expose :comment, scope: ->{ current_user.comments }`

<https://github.com/hashrocket/decent_exposure#scope>

Please try.

Adam T, if i get right, decent\_exposure will seek for UserAnswer model in this case and fall with uninitialized constant UserAnswer since there is no such model:
`expose(:user_comments) { current_user.comments }`