Method: SystemConfigController#update_database

Defined in:
app/controllers/system_config_controller.rb

#update_databaseObject

POST /system_config/database/db_name



116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# File 'app/controllers/system_config_controller.rb', line 116

def update_database
  @db_config = get_db_params

  if @db_config.valid?
    if @db_config.save
      flash[:safe_success] = 'The configuration has been saved.<br>The app will need to be restarted to use the new configuration.'
      redirect_to system_config_url
    else
      flash.now[:danger] = 'Failed to save the configuration.'
      render 'show_database'
    end
  else
    render 'show_database'
  end
end