the basics of a working remember-me-logic-flaw completed :-)

This commit is contained in:
cktricky
2014-03-15 22:30:31 -04:00
parent 1f922916d2
commit 3a5818c493
3 changed files with 21 additions and 20 deletions
+11 -1
View File
@@ -13,7 +13,7 @@ class PayController < ApplicationController
pay.user_id = current_user.user_id
msg = true if pay.save!
respond_to do |format|
format.json {render :json => {:msg => :world} }
format.json {render :json => {:msg => msg } }
end
end
@@ -23,4 +23,14 @@ class PayController < ApplicationController
end
end
def destroy
pay = Pay.find_by_id(params[:id])
if pay.present? and pay.destroy
flash[:success] = "Successfully Deleted Entry"
else
flash[:error] = "Unable to process that request at this time"
end
redirect_to user_pay_index_path
end
end
+1 -1
View File
@@ -15,7 +15,7 @@ class Pay < ActiveRecord::Base
before_save :encrypt_bank_account_num
def as_json
super(only: [:bank_account_num, :bank_routing_num, :percent_of_deposit])
super(only: [:bank_account_num, :bank_routing_num, :percent_of_deposit, :id])
end
def encrypt_bank_account_num
+9 -18
View File
@@ -97,23 +97,7 @@
</tr>
</thead>
<tbody>
<!--<tr>
<td>
December
</td>
<td>
14.7 %
</td>
<td>
31.1 %
</td>
<td>
<a class="delete-row" data-original-title="Delete" href="#">
<i class="icon-trash">
</i>
</a>
</td>
</tr>-->
</tbody>
</table>
<div class="clearfix">
@@ -132,6 +116,13 @@
<script type="text/javascript">
function buildDeleteLink(dd_id){
var link = '<a href="/users/' + '<%= current_user.id %>' + '/pay/'+ dd_id + '" data-method="delete" rel="nofollow">' +
'<i class="icon-trash">'+
'</i></a>'
return link
};
function parseDirectDepostInfo(response){
var msg = jQuery.parseJSON(JSON.stringify(response));
$.each(msg.user, function(index, val){
@@ -139,7 +130,7 @@ function parseDirectDepostInfo(response){
val.bank_account_num,
val.bank_routing_num,
val.percent_of_deposit,
"test"
buildDeleteLink(val.id)
] );
});