0.07
Repository is archived
No release in over 3 years
Low commit activity in last 3 years
This is a Rails plugin to insert the path name of a rendered partial view as HTML comment in development environment
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 5
 Project Readme

ViewSourceMap

Gem Build Status

Rails plugin to embed template path as HTML comment.

This project has done its job. Use Rails.configuration.action_view.annotate_rendered_view_with_filenames instead.

Usage

Add this line to your application's Gemfile:

group :development do
  gem "view_source_map"
end

Then you can see the rendered HTML contains some comments like this:

<!-- BEGIN app/views/hello/index.html.erb -->
<p>Hello</p>
<!-- END app/views/hello/index.html.erb -->

Disable

Sometimes this adds too much noise to the html when you're developing. There is a simple way to turn it off.

DISABLE_VIEW_SOURCE_MAP=1 rails s

or

<%= render "example_disabled", view_source_map: false %>
<%= render partial: "example_disabled_partial", view_source_map: false %>