Skip to content

Instantly share code, notes, and snippets.

@BadAllOff
Created December 22, 2016 05:37
Show Gist options
  • Save BadAllOff/73e4821b90cfb5e650fa4548c3948844 to your computer and use it in GitHub Desktop.
Save BadAllOff/73e4821b90cfb5e650fa4548c3948844 to your computer and use it in GitHub Desktop.
Params based on action name
# 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