Description:
Merge pull request #4 from sarunint/master
Implement list_all action for message console and update rails version.
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r359:b0de2bc4926f - - 4 files changed: 22 inserted, 3 deleted
@@ -0,0 +1,13 | |||
|
1 | + = user_title_bar(@user) | |
|
2 | + | |
|
3 | + %h1 Console: all messages | |
|
4 | + | |
|
5 | + = link_to '[active messages]', :action => 'list_all' | |
|
6 | + | |
|
7 | + %table | |
|
8 | + %tr | |
|
9 | + %th From | |
|
10 | + %th When | |
|
11 | + %th Message | |
|
12 | + %th | |
|
13 | + = render :partial => "short_message", :collection => @messages |
@@ -1,6 +1,6 | |||
|
1 | 1 | source 'https://rubygems.org' |
|
2 | 2 | |
|
3 |
- gem 'rails', '3.2. |
|
|
3 | + gem 'rails', '3.2.19' | |
|
4 | 4 | |
|
5 | 5 | # Bundle edge Rails instead: |
|
6 | 6 | # gem 'rails', :git => 'git://github.com/rails/rails.git' |
@@ -6,7 +6,7 | |||
|
6 | 6 | :redirect_to => { :action => 'list' } |
|
7 | 7 | |
|
8 | 8 | before_filter :admin_authorization, :only => ['console','show', |
|
9 | - 'reply','hide'] | |
|
9 | + 'reply','hide','list_all'] | |
|
10 | 10 | |
|
11 | 11 | def list |
|
12 | 12 | @user = User.find(session[:user_id]) |
@@ -22,6 +22,11 | |||
|
22 | 22 | @message = Message.find(params[:id]) |
|
23 | 23 | end |
|
24 | 24 | |
|
25 | + def list_all | |
|
26 | + @user = User.find(session[:user_id]) | |
|
27 | + @messages = Message.where(receiver_id: nil).order(:created_at) | |
|
28 | + end | |
|
29 | + | |
|
25 | 30 | def create |
|
26 | 31 | user = User.find(session[:user_id]) |
|
27 | 32 | @message = Message.new(params[:message]) |
You need to be logged in to leave comments.
Login now