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 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi Can you use Module#instance_methods ? For example admin_controller.instance_methods burlight On Mar 12, 2:53 pm, sine serz <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> 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 > > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
burlight wrote:> Hi > > Can you use Module#instance_methods ? > For example admin_controller.instance_methods > > burlight > > On Mar 12, 2:53 pm, sine serz <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>thanks burlight ;) -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > > thanks burlight ;)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 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 ) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 > > > serzMaybe give you another solution if you tell us why you need to get output all the methods in the controller? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Jamal Soueidan 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 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
sine serz wrote:> Jamal Soueidan 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 againI 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 :) before_filter :is_admin, :only => %w{method methodto} -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---