Module: SyntaxHelper

Defined in:
app/helpers/syntax_helper.rb

Instance Method Summary collapse

Instance Method Details

#rails_versionObject



10
11
12
# File 'app/helpers/syntax_helper.rb', line 10

def rails_version
   :p, Rails.version
end

#specific_page_vueObject



2
3
4
# File 'app/helpers/syntax_helper.rb', line 2

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

#vue_component(identifier, variable = nil) ⇒ Object



18
19
20
21
22
23
24
25
26
27
# File 'app/helpers/syntax_helper.rb', line 18

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

#vue_include_tagObject



6
7
8
# File 'app/helpers/syntax_helper.rb', line 6

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

#vue_on_rails_versionObject



14
15
16
# File 'app/helpers/syntax_helper.rb', line 14

def vue_on_rails_version
   :p, Vueonrails::VERSION
end