Created
December 22, 2016 05:37
-
-
Save BadAllOff/73e4821b90cfb5e650fa4548c3948844 to your computer and use it in GitHub Desktop.
Params based on action name
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Never trust parameters from the scary internet, only allow the white list through. | |
def event_params | |
if controller.action_name == 'not_usual_action' | |
params.require(:event).permit(:input_ONE) | |
else | |
params.require(:event).permit(:input_TWO) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment