Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add flash message in setting page.

  • Loading branch information...
commit d2d44b6876a23cadea1dede7367c77e372cdd1b3 1 parent 3745c3f
@chloerei authored
View
2  app/controllers/settings/accounts_controller.rb
@@ -8,7 +8,7 @@ def show
def update
if current_user.update_attributes params[:user]
- flash[:success] = 'Successful Update.'
+ flash[:success] = I18n.t(:success_update)
redirect_to :action => :show
else
render :show
View
2  app/controllers/settings/passwords_controller.rb
@@ -7,7 +7,7 @@ def show
def update
if current_user.update_attributes params[:user]
- flash[:success] = 'Successful Update.'
+ flash[:success] = I18n.t(:success_update)
redirect_to :action => :show
else
render :show
View
2  app/controllers/settings/profiles_controller.rb
@@ -7,7 +7,7 @@ def show
def update
if current_user.profile.update_attributes params[:profile]
- flash[:success] = 'Successful Update.'
+ flash[:success] = I18n.t(:success_update)
redirect_to :action => :show
else
render :show
View
1  app/views/settings/passwords/show.haml
@@ -1,3 +1,4 @@
+= render :partial => 'shared/flash_messages'
%header
%h3= t '.password_settings'
= form_for current_user, :url => settings_password_path, :validate => true do |f|
View
12 app/views/shared/_flash_messages.haml
@@ -0,0 +1,12 @@
+- if flash[:success]
+ .alert.alert-success
+ = flash[:success]
+ %button.close{'data-dismiss' => 'alert'} x
+- if flash[:notice]
+ .alert
+ = flash[:notice]
+ %button.close{'data-dismiss' => 'alert'} x
+- if flash[:error]
+ .alert.alert-error
+ = flash[:error]
+ %button.close{'data-dismiss' => 'alert'} x
View
1  config/locales/en.yml
@@ -18,6 +18,7 @@ en:
en: "English"
newest_topics_title: "%{site_name} newest topics"
tagged_newest_topics_title: "%{site_name} newest topics tagged: %{tag}"
+ success_update: "Success update"
layouts:
settings:
View
1  config/locales/zh-CN.yml
@@ -18,6 +18,7 @@ zh-CN:
en: "英文"
newest_topics_title: "%{site_name} 最新主题"
tagged_newest_topics_title: "%{site_name} 最新主题 标签:%{tag}"
+ success_update: "成功更新"
layouts:
settings:
Please sign in to comment.
Something went wrong with that request. Please try again.