RS, DG; DashboardsController has been eliminated.
This commit is contained in:
parent
cd875d06db
commit
a48fbaaf59
6 changed files with 13 additions and 20 deletions
|
|
@ -1,14 +0,0 @@
|
|||
class DashboardsController < ApplicationController
|
||||
before_filter :authenticate_user!
|
||||
include ApplicationHelper
|
||||
|
||||
def index
|
||||
if params[:group]
|
||||
@people_ids = @group.people.map {|p| p.id}
|
||||
|
||||
@posts = Post.paginate :person_id => @people_ids, :order => 'created_at DESC'
|
||||
else
|
||||
@posts = Post.paginate :page => params[:page], :order => 'created_at DESC'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -1,12 +1,16 @@
|
|||
class GroupsController < ApplicationController
|
||||
before_filter :authenticate_user!
|
||||
|
||||
def index
|
||||
@posts = Post.paginate :page => params[:page], :order => 'created_at DESC'
|
||||
end
|
||||
|
||||
def create
|
||||
@group = current_user.group(params[:group])
|
||||
|
||||
if @group.created_at
|
||||
flash[:notice] = "Successfully created group."
|
||||
redirect_to root_url
|
||||
redirect_to @group
|
||||
else
|
||||
render :action => 'new'
|
||||
end
|
||||
|
|
@ -24,7 +28,10 @@ class GroupsController < ApplicationController
|
|||
end
|
||||
|
||||
def show
|
||||
@people_ids = @group.people.map {|p| p.id}
|
||||
@posts = Post.paginate :person_id => @people_ids, :order => 'created_at DESC'
|
||||
@group = Group.first(:id => params[:id])
|
||||
render :index
|
||||
end
|
||||
|
||||
def edit
|
||||
|
|
|
|||
|
|
@ -25,14 +25,14 @@ class PhotosController < ApplicationController
|
|||
end
|
||||
|
||||
def destroy
|
||||
@photo = Photo.where(:id => params[:id]).first
|
||||
@photo = Photo.first(:id => params[:id])
|
||||
@photo.destroy
|
||||
flash[:notice] = "Successfully deleted photo."
|
||||
redirect_to @photo.album
|
||||
end
|
||||
|
||||
def show
|
||||
@photo = Photo.where(:id => params[:id]).first
|
||||
@photo = Photo.first(:id => params[:id])
|
||||
@album = @photo.album
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
#group
|
||||
%ul
|
||||
- for group in @groups
|
||||
%li{:class => ("selected" if group.id.to_s == params[:group])}
|
||||
= link_to group.name, root_path(:group =>group.id)
|
||||
%li{:class => ("selected" if group.id.to_s == params[:id])}
|
||||
= link_to group.name, group
|
||||
|
||||
%li#add_group_button.new_group= link_to "NEW GROUP", "#"
|
||||
|
||||
|
|
|
|||
|
|
@ -32,5 +32,5 @@ Diaspora::Application.routes.draw do |map|
|
|||
match 'hcard', :to => 'publics#hcard'
|
||||
|
||||
#root
|
||||
root :to => 'dashboards#index'
|
||||
root :to => 'groups#index'
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue