Add flashes back in to aspect and albums
This commit is contained in:
parent
34a4804b9f
commit
ff348eb944
3 changed files with 10 additions and 12 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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]
|
||||
|
|
|
|||
Loading…
Reference in a new issue