Class: ClassifiedAdvertisement::TasksController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ClassifiedAdvertisement::TasksController
- Defined in:
- app/controllers/classified_advertisement/tasks_controller.rb
Instance Method Summary collapse
Instance Method Details
#calendar ⇒ Object
3 4 5 |
# File 'app/controllers/classified_advertisement/tasks_controller.rb', line 3 def calendar @story = Story.find params[:story_id] end |
#events ⇒ Object
7 8 9 10 11 12 13 14 15 16 |
# File 'app/controllers/classified_advertisement/tasks_controller.rb', line 7 def events @story = Story.find params[:story_id] tasks = @story.tasks.where(:from.gte => params[:start]) tasks = tasks.map do |task| { title: task.name, url: task_path(task), start: task.from.to_s, end: task.to.to_s } end render json: tasks, root: false end |
#sign_out ⇒ Object
33 34 35 36 37 38 |
# File 'app/controllers/classified_advertisement/tasks_controller.rb', line 33 def sign_out task = Task.find(params[:id]) @error = task.sign_out(current_user.id) render layout: false end |
#sign_up ⇒ Object
25 26 27 28 29 30 31 |
# File 'app/controllers/classified_advertisement/tasks_controller.rb', line 25 def sign_up task = Task.find(params[:id]) params[:candidature] ||= {} @error = task.sign_up(current_user.id, params[:candidature][:amount]) render layout: false end |
#sign_up_form ⇒ Object
18 19 20 21 22 23 |
# File 'app/controllers/classified_advertisement/tasks_controller.rb', line 18 def sign_up_form @task = Task.find(params[:id]) @amount = @task.vacancy.candidatures.where(user_id: current_user.id).first.try(:amount) render layout: false end |