tweak flash messages
This commit is contained in:
parent
28cd5f8432
commit
59bcaf9512
|
@ -9,7 +9,7 @@ class InvitationsController < ApplicationController
|
||||||
if i.save
|
if i.save
|
||||||
i.send_email
|
i.send_email
|
||||||
flash[:success] = "Successfully e-mailed invitation to " <<
|
flash[:success] = "Successfully e-mailed invitation to " <<
|
||||||
params[:email]
|
params[:email].to_s << "."
|
||||||
else
|
else
|
||||||
flash[:error] = "Could not send invitation, verify the e-mail " <<
|
flash[:error] = "Could not send invitation, verify the e-mail " <<
|
||||||
"address is valid."
|
"address is valid."
|
||||||
|
|
|
@ -12,7 +12,7 @@ class MessagesController < ApplicationController
|
||||||
|
|
||||||
if @new_message.save
|
if @new_message.save
|
||||||
flash.now[:success] = "Your message has been sent to " <<
|
flash.now[:success] = "Your message has been sent to " <<
|
||||||
@new_message.recipient.username
|
@new_message.recipient.username.to_s << "."
|
||||||
|
|
||||||
@new_message = Message.new
|
@new_message = Message.new
|
||||||
end
|
end
|
||||||
|
@ -48,7 +48,7 @@ class MessagesController < ApplicationController
|
||||||
|
|
||||||
@message.save
|
@message.save
|
||||||
|
|
||||||
flash[:success] = "Deleted message"
|
flash[:success] = "Deleted message."
|
||||||
return redirect_to "/messages"
|
return redirect_to "/messages"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ private
|
||||||
if @message = Message.find_by_short_id(params[:message_id ] || params[:id])
|
if @message = Message.find_by_short_id(params[:message_id ] || params[:id])
|
||||||
if !(@message.author_user_id == @user.id ||
|
if !(@message.author_user_id == @user.id ||
|
||||||
@message.recipient_user_id == @user.id)
|
@message.recipient_user_id == @user.id)
|
||||||
flash[:error] = "Could not find message"
|
flash[:error] = "Could not find message."
|
||||||
redirect_to "/messages"
|
redirect_to "/messages"
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
|
@ -9,7 +9,7 @@ class SettingsController < ApplicationController
|
||||||
@edit_user = @user.clone
|
@edit_user = @user.clone
|
||||||
|
|
||||||
if @edit_user.update_attributes(params[:user])
|
if @edit_user.update_attributes(params[:user])
|
||||||
flash.now[:success] = "Successfully updated settings"
|
flash.now[:success] = "Successfully updated settings."
|
||||||
@user = @edit_user
|
@user = @edit_user
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ class SignupController < ApplicationController
|
||||||
|
|
||||||
def signup
|
def signup
|
||||||
if !(@invitation = Invitation.find_by_code(params[:invitation_code]))
|
if !(@invitation = Invitation.find_by_code(params[:invitation_code]))
|
||||||
flash[:error] = "Invalid or expired invitation"
|
flash[:error] = "Invalid or expired invitation."
|
||||||
return redirect_to "/signup"
|
return redirect_to "/signup"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ class SignupController < ApplicationController
|
||||||
if @new_user.save
|
if @new_user.save
|
||||||
@invitation.destroy
|
@invitation.destroy
|
||||||
session[:u] = @new_user.session_token
|
session[:u] = @new_user.session_token
|
||||||
flash[:success] = "Welcome to Lobsters, #{@new_user.username}"
|
flash[:success] = "Welcome to Lobsters, #{@new_user.username}!"
|
||||||
return redirect_to "/"
|
return redirect_to "/"
|
||||||
else
|
else
|
||||||
render :action => "invited"
|
render :action => "invited"
|
||||||
|
|
|
@ -27,7 +27,7 @@ class StoriesController < ApplicationController
|
||||||
Vote.vote_thusly_on_story_or_comment_for_user_because(1,
|
Vote.vote_thusly_on_story_or_comment_for_user_because(1,
|
||||||
@story.already_posted_story.id, nil, @user.id, nil)
|
@story.already_posted_story.id, nil, @user.id, nil)
|
||||||
|
|
||||||
flash[:error] = "This URL has already been submitted recently"
|
flash[:success] = "This URL has already been submitted recently."
|
||||||
|
|
||||||
return redirect_to @story.already_posted_story.comments_url
|
return redirect_to @story.already_posted_story.comments_url
|
||||||
end
|
end
|
||||||
|
@ -47,7 +47,7 @@ class StoriesController < ApplicationController
|
||||||
@page_title = "Edit Story"
|
@page_title = "Edit Story"
|
||||||
|
|
||||||
if !@story.is_editable_by_user?(@user)
|
if !@story.is_editable_by_user?(@user)
|
||||||
flash[:error] = "You cannot edit that story"
|
flash[:error] = "You cannot edit that story."
|
||||||
return redirect_to "/"
|
return redirect_to "/"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue