You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
jgdavey edited this page Aug 7, 2012
·
9 revisions
To use with the strong_parameters plugin, add a strategy:
classStrongParametersStrategy < DecentExposure::ActiveRecordWithEagerAttributesStrategydefparams_methodget? ? super : :"#{name.singularize}_params"endend
You can then use the strategy in your controller:
classUserController < ApplicationControllerexpose(:users)expose(:user,strategy: StrongParametersStrategy)private# Name a private method #{exposure_name}_paramsdefuser_paramsparams.require(:user).permit(:name,:age)end