File tree 2 files changed +10
-15
lines changed
2 files changed +10
-15
lines changed Original file line number Diff line number Diff line change @@ -34,12 +34,11 @@ def index
34
34
def create
35
35
@activity = Channel . find ( params [ :channel_id ] ) . activities . build ( params [ :activity ] )
36
36
@activity . user_id = current_user . id if @activity . action == "message"
37
- if @activity . save
38
- respond_to do |format |
37
+
38
+ respond_to do |format |
39
+ if @activity . save
39
40
format . json { render :json => @activity , :status => :created }
40
- end
41
- else
42
- respond_to do |format |
41
+ else
43
42
format . json { render :json => @activity . errors , :status => :unprocessable_entity }
44
43
end
45
44
end
Original file line number Diff line number Diff line change @@ -26,12 +26,10 @@ def index
26
26
27
27
def create
28
28
@channel = Channel . new ( params [ :channel ] )
29
- if @channel . save
30
- respond_to do | format |
29
+ respond_to do | format |
30
+ if @channel . save
31
31
format . json { render :json => @channel , :status => :created }
32
- end
33
- else
34
- respond_to do |format |
32
+ else
35
33
format . json { render :json => @channel . errors , :status => :unprocessable_entity }
36
34
end
37
35
end
@@ -46,12 +44,10 @@ def show
46
44
47
45
def update
48
46
@channel = Channel . find ( params [ :id ] )
49
- if @channel . update_attributes ( params [ :channel ] )
50
- respond_to do | format |
47
+ respond_to do | format |
48
+ if @channel . update_attributes ( params [ :channel ] )
51
49
format . json { render :json => @channel , :status => :ok }
52
- end
53
- else
54
- respond_to do |format |
50
+ else
55
51
format . json { render :json => @channel . errors , :status => :unprocessable_entity }
56
52
end
57
53
end
You can’t perform that action at this time.
0 commit comments