attribute_check for controllers in subfolders

0 views
Skip to first unread message

Houdini

unread,
Oct 4, 2009, 6:16:12 PM10/4/09
to declarative_authorization
I have controller in
app
controllers
client_interface
client_reader

well, Controller defenition is

class ClientInterface::ClientReaderController < ApplicationController
before_filter :load_client
filter_access_to :all, :attribute_check => true
layout 'client'
def show
date_for_date_chooser
end

protected
def load_client
@client = Client.find params[:id], :include => :wallets
end

end

I get error when add :attribute_check => true, error: uninitialized
constant ClientReader

Houdini

unread,
Oct 4, 2009, 7:16:02 PM10/4/09
to declarative_authorization
I am talking with myself
Well problem was not in subfolders, but declarative authorization was
incorrect detect the context, so I show it by hands, smth like this:

class ClientInterface::ClientReaderController < ApplicationController
before_filter :load_client
filter_access_to :all, :attribute_check => true, :load_method =>
lambda{@client}
layout 'client'
def show
date_for_date_chooser
end

protected
def load_client
@client = begin
Client.find params[:id], :include => :wallets
rescue ActiveRecord::RecordNotFound
nil
end
end

end
Reply all
Reply to author
Forward
0 new messages