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

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

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