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

Popular posts from this blog

.htaccess - htaccess convert request to clean url and add slash at the end of the url -

C# random value from dictionary and tuple -

algorithm - Testing tetrahedron-triangle intersection -