Get method names?

hi all

I developed user management with roles and rights, what i need now is to
build user management interface, to give roles and rights to user.

Is it possible to call controller and get all methods in a controller?
is it possible to get all controller names ?

i think something like class.method_names…

anybody?

thanks

serz

Hi

Can you use Module#instance_methods ?
For example admin_controller.instance_methods

burlight

On Mar 12, 2:53 pm, sine serz [email protected]

burlight wrote:

Hi

Can you use Module#instance_methods ?
For example admin_controller.instance_methods

burlight

On Mar 12, 2:53 pm, sine serz [email protected]

thanks burlight :wink:

sine serz wrote:

burlight wrote:

Hi

Can you use Module#instance_methods ?
For example admin_controller.instance_methods

burlight

On Mar 12, 2:53 pm, sine serz [email protected]

thanks burlight :wink:

Module#instance_methods, return all methods in a controller, but i only
need my methods in a controller not system methods.
Is it possible to get only def`s in a controller in some way?

What i was thinking is to open file then scan thru and pickup all
methods.

but this is not nice.

Any1 have an Idea?

thanks

serz

Hi serz,

Module#instance_methods, return all methods in a controller,
but i only need my methods in a controller not system methods.
Is it possible to get only def`s in a controller in some way?

What i was thinking is to open file then scan thru and pickup all
methods.

See ActionController::Base.action_methods and
ActionController::Base#action_methods

– Jean-François.


Ruby ( http://www.rubyfrance.org ) on Rails ( http://www.railsfrance.org
)

Jamal S. wrote:

sine serz wrote:

hi all

I developed user management with roles and rights, what i need now is to
build user management interface, to give roles and rights to user.

Is it possible to call controller and get all methods in a controller?
is it possible to get all controller names ?

i think something like class.method_names…

anybody?

thanks

serz

Maybe give you another solution if you tell us why you need to get
output all the methods in the controller?

thanks all, controller.action_methods works well.

I need this cause i am developing user management system, with roles and
rights, so i need to call all action_methods in a controller, so i could
give rights to roles and users.

thanks again

sine serz wrote:

hi all

I developed user management with roles and rights, what i need now is to
build user management interface, to give roles and rights to user.

Is it possible to call controller and get all methods in a controller?
is it possible to get all controller names ?

i think something like class.method_names…

anybody?

thanks

serz

Maybe give you another solution if you tell us why you need to get
output all the methods in the controller?

sine serz wrote:

Jamal S. wrote:

sine serz wrote:

hi all

I developed user management with roles and rights, what i need now is to
build user management interface, to give roles and rights to user.

Is it possible to call controller and get all methods in a controller?
is it possible to get all controller names ?

i think something like class.method_names…

anybody?

thanks

serz

Maybe give you another solution if you tell us why you need to get
output all the methods in the controller?

thanks all, controller.action_methods works well.

I need this cause i am developing user management system, with roles and
rights, so i need to call all action_methods in a controller, so i could
give rights to roles and users.

thanks again

I don’t know what you are trying to do exactly with the action_methods,
did you try to look at the before_filter? you can use it in your
controller, and give rights to certain methods for different user roles
:slight_smile:

before_filter :is_admin, :only => %w{method methodto}