ruby on rails - How To update the date in Postgresql db -
i want save date in postgresql database. therefore have written following code in controller:
def create @app_config = appconfig.new(app_config_params).to_date @app_config.save respond_with(@app_config) end private def app_config_params params.require(:app_config).permit(:freeze_attendance_till) end
but throwing error this:
actioncontroller::parametermissing (param missing or value empty)
so unable save date in db. doing wrong?
i created database using following code:
class createappconfigs < activerecord::migration def change create_table :app_configs |t| t.date :freeze_attendance_till t.timestamps null: false end end end
Comments
Post a Comment