Reputation: 541
I've dealing with an issue for some days. The thing is that I had a controller with:
private
def posts_params
params.require(:project).permit(:title,:shortDesc,:longDesc,:imgName)
end
def show
@project = Project.find(params[:id])
end
Show method didn't work till I changed the order and I put the private method at the bottom.
Is there any ruby or rails issue related with?
I'm new in RoR
Thanks in advance guys.
Upvotes: 0
Views: 34
Reputation: 7779
all methods before private are private so they can't be call from another class. you can:
def show
to change the scope.Upvotes: 2