Displaying 1 result from an estimated 1 matches for "transactionscontroller".
2012 Mar 06
0
Devise/Cancan Signout User On Controller Action
...initialize(user)
user ||= User.new # guest user
if user.role == 1 #admin
can :manage, :all
can :read, :all
elsif user.role == 2 #Vendor
can :manage, VendorTransaction
can :index, Account
end
end
end
Ok Here is my Transaction controller
require ''csv''
class TransactionsController < ApplicationController
load_and_authorize_resource
helper_method :sort_column, :sort_direction
respond_to :html, :js
def index
per_page = 40
@transactions = Transaction.search(params[:id]).order(sort_column + "
" + sort_direction)
respond_to do |format|
format.html # index.ht...