Add flashes back in to aspect and albums

This commit is contained in:
Raphael 2010-09-13 15:20:57 -07:00
parent 34a4804b9f
commit ff348eb944
3 changed files with 10 additions and 12 deletions

View file

@ -30,7 +30,7 @@ class AlbumsController < ApplicationController
def create def create
@album = current_user.post(:album, params[:album]) @album = current_user.post(:album, params[:album])
respond_with @album respond_with @album, :notice => "You've created an album called #{@album.name}."
end end
def new def new
@ -40,7 +40,7 @@ class AlbumsController < ApplicationController
def destroy def destroy
@album = Album.find_by_id params[:id] @album = Album.find_by_id params[:id]
@album.destroy @album.destroy
respond_with :location => albums_url respond_with :location => albums_url, :notice => "Album #{@album.name} destroyed."
end end
def show def show
@ -58,7 +58,7 @@ class AlbumsController < ApplicationController
def update def update
@album = Album.find_params_by_id params[:id] @album = Album.find_params_by_id params[:id]
respond_with @album respond_with @album, :notice => "Album #{@album.name} successfully edited."
end end
end end

View file

@ -30,7 +30,7 @@ class AspectsController < ApplicationController
def create def create
@aspect = current_user.aspect params[:aspect] @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 end
def new def new
@ -40,7 +40,7 @@ class AspectsController < ApplicationController
def destroy def destroy
@aspect = Aspect.find_by_id params[:id] @aspect = Aspect.find_by_id params[:id]
@aspect.destroy @aspect.destroy
respond_with :location => aspects_url respond_with :location => aspects_url, :notice => "You are no longer sharing the aspect called #{@aspect.name}."
end end
def show def show
@ -59,7 +59,7 @@ class AspectsController < ApplicationController
def update def update
@aspect = Aspect.find_by_id(params[:id]) @aspect = Aspect.find_by_id(params[:id])
@aspect.update_attributes(params[:aspect]) @aspect.update_attributes(params[:aspect])
respond_with @aspect respond_with @aspect, :notice => "Your aspect, #{@aspect.name}, has been successfully edited."
end end
def move_friends def move_friends
@ -81,9 +81,9 @@ class AspectsController < ApplicationController
flash[:error] = "didn't work #{params.inspect}" flash[:error] = "didn't work #{params.inspect}"
end end
if aspect = Aspect.first(:id => params[:to][:to]) 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 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 end
end end

View file

@ -35,11 +35,9 @@ class RequestsController < ApplicationController
if params[:accept] if params[:accept]
if params[:aspect_id] if params[:aspect_id]
@friend = current_user.accept_and_respond( params[:id], 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]), :notice => "you are now friends"
respond_with :location => current_user.aspect_by_id(params[:aspect_id])
else else
flash[:error] = "please select a aspect!" respond_with :location => requests_url, :error => "please select a aspect!"
respond_with :location => requests_url
end end
else else
current_user.ignore_friend_request params[:id] current_user.ignore_friend_request params[:id]