Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use vanilla before_filter in example subclass #8

Open
foxyblocks opened this issue Dec 8, 2014 · 0 comments
Open

Use vanilla before_filter in example subclass #8

foxyblocks opened this issue Dec 8, 2014 · 0 comments

Comments

@foxyblocks
Copy link
Contributor

In the readme example under Customizing controller behavior we use a custom authentication method authenticate_user! only: [:morph]. This method that is not really explained. We should change it to a vanilla example. Something like:

class MorphingController < Morphing::MorphingController
   before_filter :authorize_admin

   private

   def authorize_admin
     unless user.is_admin?
       flash[:error] = 'Permission denied!'
       redirect_to root_path
     end
   end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant