add max length for profile and event
This commit is contained in:
parent
358e95f701
commit
2c399fbe18
@ -1,8 +1,8 @@
|
||||
class Event < ApplicationRecord
|
||||
belongs_to :profile
|
||||
|
||||
validates :name , presence: true
|
||||
validates :text , presence: true
|
||||
validates_length_of :name , minimum: 3 , maximum: 100
|
||||
validates_length_of :text, minimum: 30 , maximum: 1200
|
||||
validates :start_date , presence: true
|
||||
validates :picture , presence: true
|
||||
|
||||
|
@ -2,9 +2,9 @@ class Profile < ApplicationRecord
|
||||
belongs_to :member
|
||||
has_many :events
|
||||
|
||||
validates :name , presence: true
|
||||
validates_length_of :name , minimum: 3 , maximum: 100
|
||||
validates_length_of :bio , minimum: 30 , maximum: 600
|
||||
validates :kind , presence: true
|
||||
validates :bio , presence: true
|
||||
validates :picture , presence: true
|
||||
|
||||
mount_uploader :picture, PictureUploader
|
||||
|
@ -12,4 +12,4 @@
|
||||
%h5.m-4.text-3xl.font-bold.text-center
|
||||
= profile.name
|
||||
.mb-8.text-gray-800.text-center
|
||||
.prose= markdown(profile.bio)
|
||||
.prose= markdown(shorten(profile.bio))
|
||||
|
Loading…
Reference in New Issue
Block a user