Class: ActivitiesController
- Inherits:
-
AuthorizedController
- Object
- AuthorizedController
- ActivitiesController
- Defined in:
- app/controllers/activities_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
20 21 22 |
# File 'app/controllers/activities_controller.rb', line 20 def create create! { @activity.project } end |
#new ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'app/controllers/activities_controller.rb', line 4 def new # Allow callers specifying defaults if params[:activity] @activity = Activity.new(params[:activity]) else @activity = Activity.new(:when => Date.today) end # Nested resources support @activity.project_id ||= params[:project_id] if params[:project_id] # Educated guessing of defaults @activity.person = current_user.person if current_user new! end |