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
result_budget_item = Hash.new | |
result_budget_item['budget_item'] = budget_item | |
result_budget_item['approved_to_date'] = budget_item.get_approved_amount | |
result_budget_item['claim_to_date'] = budget_item.get_claimed_amount | |
@result_item_hash['budget_items'] << budget_item |
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
{"error_messages":[],"success_messages":["Action performed successfully"],"status":true, | |
"data":[{"client_info": | |
{"company_name":"Client Pty Ltd","created_at":"2013-11-23T07:43:19Z","id":1, | |
"updated_at":"2013-11-23T07:43:19Z","user_id":null}, | |
"client_project_info": | |
[{"basic_info": {"client_id":1, | |
"created_at":"2013-11-23T07:45:53Z", | |
"description":"Test Project For Client Pty Ltd","id":7, | |
"name":"Test Project", |
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
$scope.reset_messages = function() { | |
$scope.error_messages = []; | |
$scope.success_messages = []; | |
$scope.show_success_message = false; | |
$scope.status = null; | |
} |
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
$scope.reset_messages(); | |
$http.post('url').success(function(data){ | |
$scope.status = data.status; | |
if (data.status) { | |
$scope.success_messages = data.success_messages; | |
} | |
else { | |
$scope.error_messages = data.error_messages; | |
} | |
}).error(function() { |
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
{"example":"this is test"} |
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
$http.get('/users_admin/list_users.json').success(function(data) { | |
if(data.status == true) { | |
$scope.users_list = data.users; | |
} | |
else { | |
$scope.error_messages = data.error_messages; | |
// add flag to show error messages in the view. | |
} | |
} |
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
@user = User.new | |
@user.user_name = params[:user_name] | |
@user.first_name = params[:first_name] | |
@user.last_name = params[:last_name] | |
@user.email = params[:email] | |
@user.password = params[:password] | |
@user.password_confirmation = params[:password_confirmation] | |
@client.user = @user | |
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
if params[:change_password] | |
if params[:password].nil? && !params[:password_confirmation].nil? && params[:password] == params[:password_confirmation] | |
@user.password = params[:password] | |
end | |
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
def add_user | |
@result = Hash.new | |
@result['status'] = true | |
@result['error_messages'] = [ ] | |
@result['success_messages'] = [ ] | |
if params[:password] == params[:password_confirmation] | |
@user = User.new | |
@user.fist_name = params[:first_name] | |
@user.last_name = params[:last_name] |
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
def additemtoorder | |
@result = Hash.new | |
@result['status'] = true | |
@result['error_messages'] = [] | |
@result['success_messages'] = [] | |
@order = Order.find(params[:id]) | |
@product = Product.find(params[:productid]) | |
@skus = ProductSku.where(:product_id=>@product.id).where(:purpose=>'primary') |
NewerOlder