I have actions called 'follow' and 'unfollow' in my controller.
Obviously, CanCan won't recognize those actions so that it shows access denied when those actions are executed.
alias_action :follow, :unfollow :to => :read
I added this line to ability.rb then it works fine now.
But the problem is when the user is not logged in it shows error like this
syntax error, unexpected ':', expecting keyword_end
alias_action :follow, :unfollow :to => :read
I only enable those actions when user is logged in.
How can I? What should I add to ability.rb?