add name to request

This commit is contained in:
sam 2022-05-25 14:02:29 +04:30
parent 07fcd5fe86
commit c771455197
3 changed files with 10 additions and 3 deletions

View File

@ -1,16 +1,18 @@
ActiveAdmin.register Message do ActiveAdmin.register Message do
csv do csv do
column :title column :title
column(:name)
column(:email) column(:email)
column(:phone) column(:phone)
column(:description)# preserve case column(:description)
# preserve case
end end
# See permitted parameters documentation: # See permitted parameters documentation:
# https://github.com/activeadmin/activeadmin/blob/master/docs/2-resource-customization.md#setting-up-strong-parameters # https://github.com/activeadmin/activeadmin/blob/master/docs/2-resource-customization.md#setting-up-strong-parameters
# #
# Uncomment all parameters which should be permitted for assignment # Uncomment all parameters which should be permitted for assignment
# #
permit_params :title, :description, :email, :phone permit_params :title, :name, :description, :email, :phone
# #
# or # or
# #

View File

@ -9,6 +9,6 @@ class MessagesController < ApplicationController
private private
def message_params def message_params
params.permit(:title, :phone, :description, :email) params.permit(:title, :phone, :description, :email, :name)
end end
end end

View File

@ -0,0 +1,5 @@
class AddNameToMessage < ActiveRecord::Migration[6.0]
def change
add_column :messages, :name, :string
end
end