docbrown/app/controllers/admin/profile_fields_controller.rb
Josh Puetz 1c566e0ec4
[deploy] Move /internal to `/admin (#9639)
* First draft - all the big changes

* Changing some more references to 'internal'

* Relocate internal request tests to admin

* Relocate internal system tests to admin

* Fix trailing space

* Test fix

* Move queries from internal to admin

* Docs updates

* Rename internal stimuls controllers to admin (plus docs)

* Rename admin layout

* Fix routing after rebase

* Fixes for latest added admin interfaces

* Serviceworker ignore paths
2020-08-07 10:36:26 -04:00

33 lines
820 B
Ruby

module Admin
class ProfileFieldsController < Admin::ApplicationController
layout "admin"
def index
@profile_fields = ProfileField.all
end
def update
@profile_fields = ProfileField.find(params[:id])
@profile_fields.update!(profile_field_params)
redirect_to admin_profile_fields_path
end
def create
@profile_field = ProfileField.create(profile_field_params)
redirect_to admin_profile_fields_path
end
def destroy
@profile_field = ProfileField.find(params[:id])
@profile_field.destroy
redirect_to admin_profile_fields_path
end
private
def profile_field_params
allowed_params = %i[input_type label active placeholder_text description]
params.require(:profile_field).permit(allowed_params)
end
end
end