SHIMADA Koji
null+****@clear*****
Tue Sep 25 19:41:59 JST 2012
SHIMADA Koji 2012-09-25 19:41:59 +0900 (Tue, 25 Sep 2012) New Revision: df7e7226b7d553c1ffd0b315ae446dfd458e6650 https://github.com/logaling/logaling-server/commit/df7e7226b7d553c1ffd0b315ae446dfd458e6650 Merged 971b851: Merge pull request #14 from logaling/prioritize-the-search Log: Use create_xx for creating UserConfig for current_user Modified files: app/controllers/user_configs_controller.rb Modified: app/controllers/user_configs_controller.rb (+1 -3) =================================================================== --- app/controllers/user_configs_controller.rb 2012-09-25 19:30:21 +0900 (67d07e7) +++ app/controllers/user_configs_controller.rb 2012-09-25 19:41:59 +0900 (ee1c52c) @@ -4,9 +4,7 @@ class UserConfigsController < ApplicationController before_filter :valid_user? def create - user_config = UserConfig.new(params[:user_config]) - user_config.user_id = params[:user_id] - user_config.save! + current_user.create_user_config(params[:user_config]) redirect_to dashboard_path, notice: 'User config was successfully set.' rescue => e redirect_to dashboard_path, notice: 'User config setting was failed.' -------------- next part -------------- An HTML attachment was scrubbed... Télécharger