by Jinook Jung
- Visit my Github repository and clone the code to your local directory:
git clone https://github.com/jinook929/_flatiron_project3.git
- Enter into the _flatiron_project3 folder:
cd _flatiron_project3
. - Execute
bundle install
and runrails s
in terminal. - Then, open your browser at
http://localhost:3000/
.
- You can either sign up for your own account or use the existing accounts to log in (You can also sign in via your Google account).
- Before logging in, you still can see evnet list and some informational pages, but you are unable to make reservations.
- If you log in as normal user (
[email protected]
, password: 123), you can create, update, and delete your own registration. - If you log in as admin user (
[email protected]
, password: 123), you can read, create, update, and delete events and users. - Each user has access to his/her own profile (user info, registered event info, edit profile option and password change) through the link on the navbar.
- Event list can be categorized by onsite and virtual.
t.string :name
t.string :email
t.string :password_digest
t.boolean :admin, default: false
t.timestamps
t.string :title
t.date :date
t.time :time, default: "12:00"
t.boolean :onsite, default: false
t.text :description
t.integer :spots
t.timestamps
t.boolean :family, default: false
t.integer :user_id
t.integer :event_id
t.timestamps
has_many :registrations, dependent: :delete_all
has_many :events, through: :registrations
has_secure_password
validates :name, presence: true
validates :email, presence: true, uniqueness: true
has_many :registrations, dependent: :delete_all
has_many :users, through: :registrations
validates_presence_of :title, :date, :time, :description, :spots
before_create :register
belongs_to :user
belongs_to :event
private
def register
self.event.spots -= 1
self.event.save
end
Bug reports and pull requests are welcome on GitHub at https://github.com/jinook929/_flatiron_project3. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
- Jinook Jung [email protected]
© Jinook Jung
The app is available as open source under the terms of the MIT License.