I have set up mercury in my application. It works properly but since I'm still very new to rails I can't set up authentication. This is what I tried after run: rails generate mercury:install:authentication
It seems I can use the module in lib directory
module Mercury module Authentication def can_edit? true if :authenticate_admin! //(from device) end end end
And I tried to use this method in the view but it doesn't work. Lib directory should be autoloaded since that row is not commented in config file.
By the way, just adding a before_filter on the update method, I prevent normal users form confirming edited pages. But they can still see the editor itself if they modify the Url manually which is unwanted.
- I tried to override Mercury Controller but it doesn't even work
Any suggestion?