Last active
December 18, 2015 15:29
-
-
Save amitpatelx/5804273 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- flash.each do |name, msg| | |
%div{:class => "alert alert-#{name == :notice ? "success" : "error"}"} | |
%a.close{"data-dismiss" => "alert"} × | |
= content_tag :div, msg, :id => "flash_#{name}" if msg.is_a?(String) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#main{:role => "main"} | |
.container | |
= render 'layouts/messages' | |
= yield |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%h3 Edit Profile | |
.row-fluid | |
.span12 | |
.full-graph | |
.padded | |
= form_for @user, url: update_profile_path, html: {class: 'form-horizontal'} do |f| | |
.control-group | |
%label.control-label First name | |
.controls | |
= f.text_field :first_name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def update | |
@user = current_user | |
if @user.update_attributes(params[:user]) | |
flash[:notice] = "Profile updated successfully" | |
redirect_to profile_url | |
else | |
flash[:error] = @user.errors.full_messages.to_sentence | |
logger.error("*******************************#{@user.errors.full_messages.to_sentence}") | |
render :action => 'edit' | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment