File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
lib/reactionview/template/handlers Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -43,13 +43,29 @@ def local_template?(template)
4343 template . identifier . start_with? ( "#{ Rails . root } /app/views" )
4444 end
4545
46+ def active_support_editor
47+ return unless defined? ( ActiveSupport ::Editor )
48+ return if ActiveSupport ::Editor . current . blank?
49+
50+ ActiveSupport ::Editor . current . instance_variable_get ( :@url_pattern ) . split ( "://" ) . first
51+ end
52+
53+ def editor_meta_tag
54+ editor_name = active_support_editor || ENV [ "RAILS_EDITOR" ] || ENV . fetch ( "EDITOR" , nil )
55+
56+ return if editor_name . blank?
57+
58+ %(<meta name="herb-default-editor" content="#{ editor_name } ">)
59+ end
60+
4661 def reactionview_dev_tools_markup ( template )
4762 return nil unless layout_template? ( template ) && ::ReActionView . config . debug_mode_enabled?
4863 return nil unless local_template? ( template )
4964
5065 <<~HTML
5166 < meta name ="herb-debug-mode " content ="true ">
52- < meta name ="herb-rails-root " content ="#{ Rails . root } ">
67+ < meta name ="herb-project-path " content ="#{ Rails . root } ">
68+ #{ editor_meta_tag }
5369
5470 #{ ActionController ::Base . new . view_context . javascript_include_tag "reactionview-dev-tools.umd.js" , defer : true }
5571 HTML
You can’t perform that action at this time.
0 commit comments