the basics of a working remember-me-logic-flaw completed :-)
This commit is contained in:
@@ -13,7 +13,7 @@ class PayController < ApplicationController
|
|||||||
pay.user_id = current_user.user_id
|
pay.user_id = current_user.user_id
|
||||||
msg = true if pay.save!
|
msg = true if pay.save!
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.json {render :json => {:msg => :world} }
|
format.json {render :json => {:msg => msg } }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -23,4 +23,14 @@ class PayController < ApplicationController
|
|||||||
end
|
end
|
||||||
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
|
end
|
||||||
|
|||||||
+1
-1
@@ -15,7 +15,7 @@ class Pay < ActiveRecord::Base
|
|||||||
before_save :encrypt_bank_account_num
|
before_save :encrypt_bank_account_num
|
||||||
|
|
||||||
def as_json
|
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
|
end
|
||||||
|
|
||||||
def encrypt_bank_account_num
|
def encrypt_bank_account_num
|
||||||
|
|||||||
@@ -97,23 +97,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<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>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<div class="clearfix">
|
<div class="clearfix">
|
||||||
@@ -132,6 +116,13 @@
|
|||||||
|
|
||||||
<script type="text/javascript">
|
<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){
|
function parseDirectDepostInfo(response){
|
||||||
var msg = jQuery.parseJSON(JSON.stringify(response));
|
var msg = jQuery.parseJSON(JSON.stringify(response));
|
||||||
$.each(msg.user, function(index, val){
|
$.each(msg.user, function(index, val){
|
||||||
@@ -139,7 +130,7 @@ function parseDirectDepostInfo(response){
|
|||||||
val.bank_account_num,
|
val.bank_account_num,
|
||||||
val.bank_routing_num,
|
val.bank_routing_num,
|
||||||
val.percent_of_deposit,
|
val.percent_of_deposit,
|
||||||
"test"
|
buildDeleteLink(val.id)
|
||||||
] );
|
] );
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user