diff options
author | Raphael <raphael@joindiaspora.com> | 2010-09-14 02:20:57 +0400 |
---|---|---|
committer | Raphael <raphael@joindiaspora.com> | 2010-09-14 02:20:57 +0400 |
commit | ff348eb94425c95c37159d204add442565cb47df (patch) | |
tree | eda5526fd985349e4aee3d9ecc1b1b6831b93e4b | |
parent | 34a4804b9f7d2128fb86936d287a1c2b1986692e (diff) |
Add flashes back in to aspect and albums
-rw-r--r-- | app/controllers/albums_controller.rb | 6 | ||||
-rw-r--r-- | app/controllers/aspects_controller.rb | 10 | ||||
-rw-r--r-- | app/controllers/requests_controller.rb | 6 |
3 files changed, 10 insertions, 12 deletions
diff --git a/app/controllers/albums_controller.rb b/app/controllers/albums_controller.rb index 094f7e469..47aa8181f 100644 --- a/app/controllers/albums_controller.rb +++ b/app/controllers/albums_controller.rb @@ -30,7 +30,7 @@ class AlbumsController < ApplicationController def create @album = current_user.post(:album, params[:album]) - respond_with @album + respond_with @album, :notice => "You've created an album called #{@album.name}." end def new @@ -40,7 +40,7 @@ class AlbumsController < ApplicationController def destroy @album = Album.find_by_id params[:id] @album.destroy - respond_with :location => albums_url + respond_with :location => albums_url, :notice => "Album #{@album.name} destroyed." end def show @@ -58,7 +58,7 @@ class AlbumsController < ApplicationController def update @album = Album.find_params_by_id params[:id] - respond_with @album + respond_with @album, :notice => "Album #{@album.name} successfully edited." end end diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index 0253e819f..8b9f39a4b 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -30,7 +30,7 @@ class AspectsController < ApplicationController def create @aspect = current_user.aspect params[:aspect] - respond_with @aspect + respond_with @aspect, :notice => "Click on the plus on the left side to tell Diaspora who can see your new aspect." end def new @@ -40,7 +40,7 @@ class AspectsController < ApplicationController def destroy @aspect = Aspect.find_by_id params[:id] @aspect.destroy - respond_with :location => aspects_url + respond_with :location => aspects_url, :notice => "You are no longer sharing the aspect called #{@aspect.name}." end def show @@ -59,7 +59,7 @@ class AspectsController < ApplicationController def update @aspect = Aspect.find_by_id(params[:id]) @aspect.update_attributes(params[:aspect]) - respond_with @aspect + respond_with @aspect, :notice => "Your aspect, #{@aspect.name}, has been successfully edited." end def move_friends @@ -81,9 +81,9 @@ class AspectsController < ApplicationController flash[:error] = "didn't work #{params.inspect}" end if aspect = Aspect.first(:id => params[:to][:to]) - redirect_to aspect + respond_with aspect, :notice => "You are now showing your friend a different aspect of yourself." else - redirect_to Person.first(:id => params[:friend_id]) + respond_with Person.first(:id => params[:friend_id]), :notice => "You are now showing your friend a different aspect of yourself." end end end diff --git a/app/controllers/requests_controller.rb b/app/controllers/requests_controller.rb index 5d863661c..04cf0e9cd 100644 --- a/app/controllers/requests_controller.rb +++ b/app/controllers/requests_controller.rb @@ -35,11 +35,9 @@ class RequestsController < ApplicationController if params[:accept] if params[:aspect_id] @friend = current_user.accept_and_respond( params[:id], params[:aspect_id]) - flash[:notice] = "you are now friends" - respond_with :location => current_user.aspect_by_id(params[:aspect_id]) + respond_with :location => current_user.aspect_by_id(params[:aspect_id]), :notice => "you are now friends" else - flash[:error] = "please select a aspect!" - respond_with :location => requests_url + respond_with :location => requests_url, :error => "please select a aspect!" end else current_user.ignore_friend_request params[:id] |