This file contains 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
# in User model | |
def update_with_password(params={}) | |
unless params.key?(:current_password) | |
if params[:password].blank? | |
params.delete(:password) | |
params.delete(:password_confirmation) if params[:password_confirmation].blank? | |
end | |
update_attributes(params) |
This file contains 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
#routes.rb | |
map.articles '/articles', :controller => 'posts', :action=>'index' | |
map.posts '/posts', :controller => 'posts', :action=>'redirect' | |
map.resources :posts | |
#posts_controller.rb | |
def redirect | |
redirect_to articles_path, :status => 301 | |
end |
This file contains 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
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6eAVWnVEHuxEzepqKoKx33UNlFwsuT3fA1Vz8NO50MSTrB22vxGroGpemnBpunFSWfkum2zbbW7mCFabMEhugILuBCJWpWmPt+bqCnM/Ze7Hu71+mPsI+Sb+Mz1NNbstrMwaXSJsh3D/pbE5lO8Hvgt6bJjsBNA73k/ZsBeRvOJAiAQ2tep1/KHU/Uccq04jrKARmkrCUAHSKFC8K7uzUbagtPWJI6du/1V3nU/CalFM43Yqk28aClw6V68BzrGITHG5qQLBex79jHTncXfA2xQ6tFD7fK2bNZ2wBwM0wWnr7dKUTogAzzlFaRMu0FU6qICwYC3cJFCXdhmVN3dWtQ== superp@superp-hp |
NewerOlder