This commit is contained in:
sam 2022-05-14 16:29:26 +04:30
parent 0185ac276c
commit 23bb0bca0d
5 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,3 @@
// Place all the styles related to the Messages controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: https://sass-lang.com/

View File

@ -0,0 +1,13 @@
class MessagesController < ApplicationController
skip_before_action :verify_authenticity_token
def create
@message = Message.create(message_params)
end
private
def message_params
params.permit(:title, :phone, :description, :email)
end
end

View File

@ -0,0 +1,2 @@
module MessagesHelper
end

View File

@ -1,5 +1,6 @@
Rails.application.routes.draw do
devise_for :admin_users, ActiveAdmin::Devise.config
ActiveAdmin.routes(self)
resources :messages, controller: 'messages'
# For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html
end

View File

@ -0,0 +1,7 @@
require 'test_helper'
class MessagesControllerTest < ActionDispatch::IntegrationTest
# test "the truth" do
# assert true
# end
end