tweak flash messages

This commit is contained in:
joshua stein 2012-07-03 22:31:42 -05:00
parent 28cd5f8432
commit 59bcaf9512
5 changed files with 9 additions and 9 deletions

View file

@ -9,7 +9,7 @@ class InvitationsController < ApplicationController
if i.save
i.send_email
flash[:success] = "Successfully e-mailed invitation to " <<
params[:email]
params[:email].to_s << "."
else
flash[:error] = "Could not send invitation, verify the e-mail " <<
"address is valid."

View file

@ -12,7 +12,7 @@ class MessagesController < ApplicationController
if @new_message.save
flash.now[:success] = "Your message has been sent to " <<
@new_message.recipient.username
@new_message.recipient.username.to_s << "."
@new_message = Message.new
end
@ -48,7 +48,7 @@ class MessagesController < ApplicationController
@message.save
flash[:success] = "Deleted message"
flash[:success] = "Deleted message."
return redirect_to "/messages"
end
@ -64,7 +64,7 @@ private
if @message = Message.find_by_short_id(params[:message_id ] || params[:id])
if !(@message.author_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"
return false
end

View file

@ -9,7 +9,7 @@ class SettingsController < ApplicationController
@edit_user = @user.clone
if @edit_user.update_attributes(params[:user])
flash.now[:success] = "Successfully updated settings"
flash.now[:success] = "Successfully updated settings."
@user = @edit_user
end

View file

@ -29,7 +29,7 @@ class SignupController < ApplicationController
def signup
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"
end
@ -39,7 +39,7 @@ class SignupController < ApplicationController
if @new_user.save
@invitation.destroy
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 "/"
else
render :action => "invited"

View file

@ -27,7 +27,7 @@ class StoriesController < ApplicationController
Vote.vote_thusly_on_story_or_comment_for_user_because(1,
@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
end
@ -47,7 +47,7 @@ class StoriesController < ApplicationController
@page_title = "Edit Story"
if !@story.is_editable_by_user?(@user)
flash[:error] = "You cannot edit that story"
flash[:error] = "You cannot edit that story."
return redirect_to "/"
end
end