Conditions | 2 |
Total Lines | 21 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | class AttendancesController < ApplicationController |
||
16 | def create |
||
17 | @attendance = @session.attendances.find_or_initialize_by(participant: current_participant) |
||
18 | if @attendance.save |
||
19 | respond_to do |format| |
||
20 | format.html do |
||
21 | flash[:notice] = "Thanks for your interest in this session." |
||
22 | redirect_to @session |
||
23 | end |
||
24 | |||
25 | format.json do |
||
26 | render :partial => 'sessions/participant', :formats => ['html'], :locals => { :participant => current_participant } |
||
27 | end |
||
28 | end |
||
29 | else |
||
30 | respond_to do |format| |
||
31 | format.json do |
||
32 | render :partial => 'sessions/new_participant', :formats => ['html'], :status => :unprocessable_entity |
||
33 | end |
||
34 | end |
||
35 | end |
||
36 | end |
||
37 | |||
65 |