JDutil / contact_us

Gem providing simple Contact Form functionality with a Rails 3+ Engine.
http://contact-us-demo.herokuapp.com
MIT License
135 stars 57 forks source link

Exclude Contact Us Controller from Authorization/Authentication #61

Closed matt-burgess closed 7 years ago

matt-burgess commented 7 years ago

I have this filter in my ApplicationController and would like to add this controller so that my contact us form is not behind authentication. Can I do something similar or is there another technique to accomplish this?

before_action :authorize, unless: :devise_controller?

JDutil commented 7 years ago

You could skip the before action if it's the contact controller, which would be something like: skip_before_action :authorize, if: -> { params[:controller] == 'contact_us/contacts' }