add dates to signup

This commit is contained in:
Torsten 2023-06-03 19:45:14 +03:00
parent 5a5f0585fb
commit 0605c1ea2f
5 changed files with 15 additions and 5 deletions

View File

@ -8,7 +8,7 @@ class ApplicationController < ActionController::Base
protected
def configure_permitted_parameters
devise_parameter_sanitizer.permit(:sign_up, keys: [:name])
devise_parameter_sanitizer.permit(:sign_up, keys: [:name , :arriving , :leaving])
end
def user_not_authorized

View File

@ -23,7 +23,6 @@ class RegistrationsController < Devise::RegistrationsController
def edit_email
build_resource
puts "EDIT"
end
def edit
@ -32,7 +31,6 @@ class RegistrationsController < Devise::RegistrationsController
end
def update
puts "UPDATE"
super
end
@ -62,7 +60,6 @@ class RegistrationsController < Devise::RegistrationsController
# The path used after sign up.
def after_sign_up_path_for(resource)
puts "after sign up"
super(resource)
end

View File

@ -20,6 +20,7 @@ class Member < ApplicationRecord
validates :bio, length: { maximum: 1000 }
validates :name , length: { minimum: 3 }
validates_presence_of :arriving , :leaving
def admin
self.email == "torsten@villataika.fi"

View File

@ -8,7 +8,7 @@
.mb-4
= f.label :name, class: "block font-bold mb-2 text-gray-700 text-sm"
= f.input :name,
placeholder: "Pekka Virtanen",
placeholder: "Pekka",
class: "appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none shadow focus:shadow-outline"
.mb-4
= f.label :email, class: "block font-bold mb-2 text-gray-700 text-sm"
@ -16,6 +16,14 @@
autocomplete: "email",
placeholder: "user@example.com",
class: "appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none shadow focus:shadow-outline"
.mb-4
= f.label :date, class: "block font-bold mb-2 text-gray-700 text-sm"
= f.date_field :arriving,
class: "appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none shadow focus:shadow-outline"
.mb-4
= f.label :date, class: "block font-bold mb-2 text-gray-700 text-sm"
= f.date_field :leaving,
class: "appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none shadow focus:shadow-outline"
.mb-4
= f.label :password, class: "block font-bold mb-2 text-gray-700 text-sm"
- if @minimum_password_length

View File

@ -18,6 +18,10 @@
%button.bg-cyan-200.mr-3.inline-block.rounded-lg.px-4.py-3.text-md.font-medium.border.border-gray-400
Edit Profile
= link_to edit_member_registration_path do
%button.bg-cyan-200.mr-3.inline-block.rounded-lg.px-4.py-3.text-md.font-medium.border.border-gray-400
Change Password
= link_to new_story_path() do
%button.bg-cyan-200.mr-3.inline-block.rounded-lg.px-4.py-3.text-md.font-medium.border.border-gray-400
New Story