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