I have a partial that is placed in many different pages, or, in rails terms, participates in many different actions. So, the partial _list.rhtml is on ./admin/show.rhtml and it''s also on ./admin/find.rhtml I want the partial _list.rhtml to have different behaviors for show and find. Is there an object available on a page, that contains the controller and action for that page? Charlie --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
If you just want to know the action that was requested in the url, params[:action] will have it charlie caroff wrote:> I have a partial that is placed in many different pages, or, in rails > terms, participates in many different actions. > > So, the partial _list.rhtml is on > > ./admin/show.rhtml > > and it''s also on > > ./admin/find.rhtml > > I want the partial _list.rhtml to have different behaviors for show > and find. Is there an object available on a page, that contains the > controller and action for that page? > > Charlie > > > > >-- Sincerely, William Pratt http://www.billpratt.net billp-YbheRAKfYF4eIZ0/mPfg9Q@public.gmane.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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thank you. And, for the sake of other newbies like me, params[:controller] has the controller name in it. Charlie On Aug 18, 12:34 pm, William Pratt <bi...-YbheRAKfYF4eIZ0/mPfg9Q@public.gmane.org> wrote:> If you just want to know the action that was requested in the url, > params[:action] will have it > > > > charlie caroff wrote: > > I have a partial that is placed in many different pages, or, in rails > > terms, participates in many different actions. > > > So, the partial _list.rhtml is on > > > ./admin/show.rhtml > > > and it''s also on > > > ./admin/find.rhtml > > > I want the partial _list.rhtml to have different behaviors for show > > and find. Is there an object available on a page, that contains the > > controller and action for that page? > > > Charlie > > -- > Sincerely, > > William Pratt > > http://www.billpratt.net > bi...-YbheRAKfYF4eIZ0/mPfg9Q@public.gmane.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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Sorry about that, I missed the part about the controller. Not enough coffee yet :) charlie caroff wrote:> Thank you. And, for the sake of other newbies like me, > params[:controller] has the controller name in it. > > Charlie > > On Aug 18, 12:34 pm, William Pratt <bi...-YbheRAKfYF4eIZ0/mPfg9Q@public.gmane.org> wrote: > >> If you just want to know the action that was requested in the url, >> params[:action] will have it >> >> >> >> charlie caroff wrote: >> >>> I have a partial that is placed in many different pages, or, in rails >>> terms, participates in many different actions. >>> >>> So, the partial _list.rhtml is on >>> >>> ./admin/show.rhtml >>> >>> and it''s also on >>> >>> ./admin/find.rhtml >>> >>> I want the partial _list.rhtml to have different behaviors for show >>> and find. Is there an object available on a page, that contains the >>> controller and action for that page? >>> >>> Charlie >>> >> -- >> Sincerely, >> >> William Pratt >> >> http://www.billpratt.net >> bi...-YbheRAKfYF4eIZ0/mPfg9Q@public.gmane.org >> > > > > >-- Sincerely, William Pratt http://www.billpratt.net billp-YbheRAKfYF4eIZ0/mPfg9Q@public.gmane.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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---