Adding fields to an object
1. Document it in object model, in the `#structure do` block eg: _models/effective/User.rb_
2. Create a database migration for the fields - run command such as: `rails generate migration add_fields_to_users participant:string how_did_you_hear:string` and it will generate the file for you (migrations appear in _db/migrate/12345_add_fields_to_users.rb_)
3. Run rake db:migrate
http://edgeguides.rubyonrails.org/active_record_migrations.html
Adding a View to Prototype
1. in routes.rb, change the team dashboard to be `only: [:index]`
2. in team dashboard controller, add the index action just like the show action
3. also in team dashboard controller add `skip_authorization_check # CanCanCan ` to the top of the page to bypass user authorization
3. then create /app/views/team_dashboard/index.html.haml
4. then visit /team_dashboard
Add a New Page
1. update routes.rb with the invitations resource, nested in a users namespace (similar to admin).
2. create /app/controllers/users/invitations_controller.rb
3. create /app/views/users/invitations/new.html.haml
Adding a Datatable
1. Create datatable in _models/effective/datatables_, eg. _models/effective/datatables/users.rb_
2. Define datatable constant in controller, eg. _controllers/admin/users_controller.rb_ : `@datatable = Effective::Datatables::Users.new`
3. Render the datatable in your view `= render_datatable(@datatable)`
Simple Form
= simple_form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f|
You can also view online:
http://espcn-prototype.herokuapp.com
User: espcn
Pass: prototype
http://scip-prototype.herokuapp.com/
User: scip
Pass: prototype