Hi, Is there a way I can figure out which files are run for a specific URL? Given http://www.planet.com/countries files like: countries/ index.html.erb, countries/_country.html.erb, layouts/ application.html.erb and so on. Thank You -- M. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Marcelo Barbudas wrote:> Given http://www.planet.com/countries files like: countries/ > index.html.erb, countries/_country.html.erb, layouts/ > application.html.erb and so on. >You really need to look at the routing and the controller code and the request type to know for sure. http://www.planet.com/countries will generally go to the countries controller, the index method in that controller, using application.html.erb and the index.html.erb view to render the view. That is all dependent on the assumption that the application does not diverge from ''vanilla'' Rails. What template does the controller actually use? Does the index method go to index.html.erb, or is the controller method actually invoking a different view?, etc... That''ll get you to the first view level. Then you need to see what the particular view does. Does it include partials? If so, which ones and from where? -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
If developer followed starndart rules and pure REST, you could guess that `countries/105` will render `app/views/countries/show.html.erb` But sometimes it''s not that simple. So, you need to look at `routes.rb` to find which controller and action this URL calls. And then look inside action for irregular ''render :something''. Also, look through log/development(test/production).log for strings like "Rendering template something/something.erb". I''m not sure about Webrick, but Mongrel will show you that info in logs. On Mon, Apr 19, 2010 at 9:13 PM, Marcelo Barbudas <nostef-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > Is there a way I can figure out which files are run for a specific > URL? > > Given http://www.planet.com/countries files like: countries/ > index.html.erb, countries/_country.html.erb, layouts/ > application.html.erb and so on. > > > Thank You > -- > M. > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Mon, Apr 19, 2010 at 9:13 AM, Marcelo Barbudas <nostef-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > Is there a way I can figure out which files are run for a specific > URL? > > Given http://www.planet.com/countries files like: countries/ > index.html.erb, countries/_country.html.erb, layouts/ > application.html.erb and so on. >Probably not *exactly* what you''re after, but http://github.com/anildigital/partioprint might be of interest. It adds (in dev mode) the names of partials as HTML comments in the output rendered via ERB files. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.