https://github.com/iacobson/attend-activities-rails
test app in rails to attend activities created by users
https://github.com/iacobson/attend-activities-rails
Last synced: about 2 months ago
JSON representation
test app in rails to attend activities created by users
- Host: GitHub
- URL: https://github.com/iacobson/attend-activities-rails
- Owner: iacobson
- Created: 2014-12-11T10:08:15.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-12-11T21:12:49.000Z (over 10 years ago)
- Last Synced: 2025-03-29T02:36:53.946Z (2 months ago)
- Language: Ruby
- Size: 164 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Attend-Activities-Rails
=======================test app in rails to attend activities created by users
Application Steps:
1. Install default DEVISE gem commands
2. Create scaffold for Activity, with reference to User, to create user_id fiesd in activity
$ rails generate scaffold Activity description:text user:references
- update the User model: has_many :activities3. $ rake db:migrate
4. Add name field to User
a. generate migrateion
$ rails generate migration add_username_to_User username:text
$ rake db:migrate
b. adding Username the field in the view files
- registrations/new.html.erb
- registrations/edit.html.erb
c. customize the strong parameters for the devise controller action to add Username
- follow instructions here: http://www.jacopretorius.net/2014/03/adding-custom-fields-to-your-devise-user-model-in-rails-4.html
- simply create a new controller file: registrations_controller.rb
- inside customize the code provided in the above tutorial
- configure routes.rb to read the registrations controllerNow the DEVISE is working with new field USERNAME
__________________
Database table relations:
Users - Activities
- one to manyActivities - Joining - Attendees
- many to many through Joining
$ rails generate scaffold Attendee user_id:integer
$ rails generate model Joining activity:references attendee:references