diff --git a/app/models/event.rb b/app/models/event.rb index 219a74a..8a6af44 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -2,4 +2,7 @@ class Event < ActiveRecord::Base belongs_to :location has_many :volunteerRsvps has_many :users, :through => :volunteerRsvps + validates_presence_of :title + validates_presence_of :location + validates_presence_of :date end diff --git a/app/views/events/edit.html.erb b/app/views/events/edit.html.erb index d7d4525..2abe7e1 100644 --- a/app/views/events/edit.html.erb +++ b/app/views/events/edit.html.erb @@ -3,4 +3,5 @@ <%= render 'form' %> <%= link_to 'Show', @event %> | -<%= link_to 'Back', events_path %> +<%= link_to 'Back', events_path %> | +<%= link_to 'Manage Locations', locations_path %> diff --git a/app/views/events/index.html.erb b/app/views/events/index.html.erb index f0faeb7..e9ae0b0 100644 --- a/app/views/events/index.html.erb +++ b/app/views/events/index.html.erb @@ -30,6 +30,8 @@
<%= link_to 'New Event', new_event_path %> - +| <%= link_to 'Add Your Skills',edit_user_registration_path %> +| +<%= link_to 'Manage Locations', locations_path %> diff --git a/app/views/events/new.html.erb b/app/views/events/new.html.erb index 6119978..0728626 100644 --- a/app/views/events/new.html.erb +++ b/app/views/events/new.html.erb @@ -3,3 +3,5 @@ <%= render 'form' %> <%= link_to 'Back', events_path %> +| +<%= link_to 'Manage Locations', locations_path %> \ No newline at end of file diff --git a/db/schema.rb b/db/schema.rb index 69b795f..328c801 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1,79 +1,79 @@ -# encoding: UTF-8 -# This file is auto-generated from the current state of the database. Instead -# of editing this file, please use the migrations feature of Active Record to -# incrementally modify your database, and then regenerate this schema definition. -# -# Note that this schema.rb definition is the authoritative source for your -# database schema. If you need to create the application database on another -# system, you should be using db:schema:load, not running all the migrations -# from scratch. The latter is a flawed and unsustainable approach (the more migrations -# you'll amass, the slower it'll run and the greater likelihood for issues). -# -# It's strongly recommended to check this file into your version control system. - -ActiveRecord::Schema.define(:version => 20120313184512) do - - create_table "events", :force => true do |t| - t.string "title" - t.datetime "created_at" - t.datetime "updated_at" - t.datetime "date" - t.integer "location_id" - end - - create_table "locations", :force => true do |t| - t.string "name" - t.text "address" - t.datetime "created_at" - t.datetime "updated_at" - end - - create_table "users", :force => true do |t| - t.string "email", :default => "", :null => false - t.string "encrypted_password", :limit => 128, :default => "", :null => false - t.string "reset_password_token" - t.datetime "reset_password_sent_at" - t.datetime "remember_created_at" - t.integer "sign_in_count", :default => 0 - t.datetime "current_sign_in_at" - t.datetime "last_sign_in_at" - t.string "current_sign_in_ip" - t.string "last_sign_in_ip" - t.string "confirmation_token" - t.datetime "confirmed_at" - t.datetime "confirmation_sent_at" - t.integer "failed_attempts", :default => 0 - t.string "unlock_token" - t.datetime "locked_at" - t.string "authentication_token" - t.datetime "created_at" - t.datetime "updated_at" - t.boolean "teaching" - t.boolean "taing" - t.boolean "coordinating" - t.boolean "childcaring" - t.boolean "writing" - t.boolean "hacking" - t.boolean "designing" - t.boolean "evangelizing" - t.boolean "mentoring" - t.boolean "macosx" - t.boolean "windows" - t.boolean "linux" - t.string "other" - end - - add_index "users", ["confirmation_token"], :name => "index_users_on_confirmation_token", :unique => true - add_index "users", ["email"], :name => "index_users_on_email", :unique => true - add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token", :unique => true - add_index "users", ["unlock_token"], :name => "index_users_on_unlock_token", :unique => true - - create_table "volunteer_rsvps", :force => true do |t| - t.integer "user_id" - t.integer "event_id" - t.boolean "attending" - t.datetime "created_at" - t.datetime "updated_at" - end - -end +# encoding: UTF-8 +# This file is auto-generated from the current state of the database. Instead +# of editing this file, please use the migrations feature of Active Record to +# incrementally modify your database, and then regenerate this schema definition. +# +# Note that this schema.rb definition is the authoritative source for your +# database schema. If you need to create the application database on another +# system, you should be using db:schema:load, not running all the migrations +# from scratch. The latter is a flawed and unsustainable approach (the more migrations +# you'll amass, the slower it'll run and the greater likelihood for issues). +# +# It's strongly recommended to check this file into your version control system. + +ActiveRecord::Schema.define(:version => 20120313184512) do + + create_table "events", :force => true do |t| + t.string "title" + t.datetime "created_at" + t.datetime "updated_at" + t.datetime "date" + t.integer "location_id" + end + + create_table "locations", :force => true do |t| + t.string "name" + t.text "address" + t.datetime "created_at" + t.datetime "updated_at" + end + + create_table "users", :force => true do |t| + t.string "email", :default => "", :null => false + t.string "encrypted_password", :limit => 128, :default => "", :null => false + t.string "reset_password_token" + t.datetime "reset_password_sent_at" + t.datetime "remember_created_at" + t.integer "sign_in_count", :default => 0 + t.datetime "current_sign_in_at" + t.datetime "last_sign_in_at" + t.string "current_sign_in_ip" + t.string "last_sign_in_ip" + t.string "confirmation_token" + t.datetime "confirmed_at" + t.datetime "confirmation_sent_at" + t.integer "failed_attempts", :default => 0 + t.string "unlock_token" + t.datetime "locked_at" + t.string "authentication_token" + t.datetime "created_at" + t.datetime "updated_at" + t.boolean "teaching" + t.boolean "taing" + t.boolean "coordinating" + t.boolean "childcaring" + t.boolean "writing" + t.boolean "hacking" + t.boolean "designing" + t.boolean "evangelizing" + t.boolean "mentoring" + t.boolean "macosx" + t.boolean "windows" + t.boolean "linux" + t.string "other" + end + + add_index "users", ["confirmation_token"], :name => "index_users_on_confirmation_token", :unique => true + add_index "users", ["email"], :name => "index_users_on_email", :unique => true + add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token", :unique => true + add_index "users", ["unlock_token"], :name => "index_users_on_unlock_token", :unique => true + + create_table "volunteer_rsvps", :force => true do |t| + t.integer "user_id" + t.integer "event_id" + t.boolean "attending" + t.datetime "created_at" + t.datetime "updated_at" + end + +end