Sha256: 94b59517f259eaf739496dd9ad0e71a19376a7912c7985a8d8db8de59d553e9c

Contents?: true

Size: 841 Bytes

Versions: 1

Compression:

Stored size: 841 Bytes

Contents

module SyntaxHelper
  def specific_page_vue
    " #{controller_name} #{action_name} "
  end

  def vue_include_tag
    javascript_include_tag "https://cdn.jsdelivr.net/npm/vue/dist/vue.js" if Rails.env.development?
  end

  def rails_version
    content_tag :p, Rails.version
  end

  def vue_on_rails_version
    content_tag :p, Vueonrails::VERSION
  end

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

  #server side rendering via hypernova
  def render_vue_component(id, data = {})
    render_react_component(id, data)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vueonrails-1.0.0.beta5 app/helpers/syntax_helper.rb