Module: Glslkit::Rails::Helper
- Defined in:
- lib/glslkit/rails/helper.rb
Overview
ActionView上でincludeされるビューヘルパー (§4.3)。
Instance Method Summary collapse
-
#glsl_manifest_tag(**html_options) ⇒ Object
<%= glsl_manifest_tag %> => .
-
#glsl_script_tag(logical_path, **html_options) ⇒ Object
<%= glsl_script_tag "pbr.vert" %> => .
Instance Method Details
#glsl_manifest_tag(**html_options) ⇒ Object
<%= glsl_manifest_tag %> =>
20 21 22 23 24 25 26 |
# File 'lib/glslkit/rails/helper.rb', line 20 def glsl_manifest_tag(**) [:id] ||= "glsl-manifest" [:type] = "application/json" apply_glsl_nonce!() content_tag(:script, (Glslkit::Rails.manifest.to_json).html_safe, ) end |
#glsl_script_tag(logical_path, **html_options) ⇒ Object
<%= glsl_script_tag "pbr.vert" %> =>
9 10 11 12 13 14 15 16 |
# File 'lib/glslkit/rails/helper.rb', line 9 def glsl_script_tag(logical_path, **) asset = find_glsl_asset(logical_path) [:id] ||= glsl_script_id(logical_path.to_s) [:type] = asset.content_type.to_s apply_glsl_nonce!() content_tag(:script, (asset.compiled_content).html_safe, ) end |