I am new in Rails development, my first project is a simple website
where user can signed up and register for an event. I have created the
event model and used ‘devise’ for user model and authentication. I have
set the event.rb:
class Event < ActiveRecord::Base
has_many :user
end
and the user.rb:
class User < ActiveRecord::Base
belongs_to :event
Include default devise modules. Others available are:
:token_authenticatable, :encryptable, :confirmable, :lockable,
:timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
Setup accessible (or protected) attributes for your model
attr_accessible :email, :password, :password_confirmation,
:remember_me
end
My question is how to add the current signed-in username to event model
relevant (participants) field.
Thank you in advance! Szabolcs