Sha256: 7c4c38d62c5a36482b82b0db4fa9776491dcb31fcb72d5e1c727f4983dc1be40

Contents?: true

Size: 871 Bytes

Versions: 5

Compression:

Stored size: 871 Bytes

Contents

module SyntaxHelper
  def page_specific_vue
    return " #{controller_name} #{action_name} "
  end

  def vue_include_tag(version)
    javascript_include_tag "https://cdnjs.cloudflare.com/ajax/libs/vue/#{version}/vue.js" if Rails.env.development?
  end

  def rails_version
    "<p>#{Rails.version}</p>".html_safe
  end

  def vuejs_gem_version
     "<p>#{Vuejs::VERSION}</p>".html_safe
  end
  
  def vue_component(identifier, variable)
    concat("<div id=\"#{identifier}\" refs=\"#{identifier}\">".html_safe)
    concat("</div>".html_safe)
    variable.each {|key, value| 
      concat("<div id=\"vueonrails-#{key}\" data-#{key}=\"#{value}\">".html_safe)
      concat("</div>".html_safe)
    }; nil
  end

  def vue(identifier)
    concat("<div id=\"#{identifier}\" refs=\"#{identifier}\">".html_safe)
    yield
    concat("</div>".html_safe)
  end

  alias v vue
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
vuejs-1.1.0.beta7 app/helpers/syntax_helper.rb
vuejs-1.1.0.beta6 app/helpers/syntax_helper.rb
vuejs-1.1.0.beta5 app/helpers/syntax_helper.rb
vuejs-1.1.0.beta4 app/helpers/syntax_helper.rb
vuejs-1.1.0.beta3 app/helpers/syntax_helper.rb