ruby - Rails - how to add parameter to the "params.require(:model).permit" construction? -
i have following code in controller:
def create @company = company.new(company_params) .... end private def company_params params.require(:company).permit(...list of columns...).merge(latlng: geocode) end
i need save database column called slug. value of column be
slug = params[:company][:name].parameterize
the column slug not mentioned in permit list. how add & save information database?
thanks
Comments
Post a Comment