grape api - use rails 4.0 strong parameter in non rails application -
i use active-record 4.0 in grape api application, strong parameter works in rails controller, how permit params in grape api class
there seems way use strong parameters outside controller
raw_parameters = { :email => "john@example.com", :name => "john", :admin => true } parameters = actioncontroller::parameters.new(raw_parameters) user = user.create(parameters.permit(:name, :email))
for more info check repository documentation on github https://github.com/rails/strong_parameters
regards
Comments
Post a Comment